Commit 011778a7 authored by Conor Anderson's avatar Conor Anderson

Update install script [skip ci]

parent fe914ea4
Pipeline #41474343 skipped
......@@ -17,7 +17,7 @@ This package, currently at a very early stage of development, will eventually ho
This package can be installed via the `install_git()` function in the `devtools` or `remotes` packages, or by running the following convenience script.
``` {r, eval = FALSE}
source("https://gitlab.com/ConorIA/claut/raw/master/install_claut.R")
source("https://gitlab.com/snippets/1793256/raw");install("claut")
```
## Functions used in published papers
......
......@@ -22,7 +22,7 @@ convenience
script.
``` r
source("https://gitlab.com/ConorIA/claut/raw/master/install_claut.R")
source("https://gitlab.com/snippets/1793256/raw");install("claut")
```
## Functions used in published papers
......
cat("##### PSA ##### \n
You are about to run remote code! It is always a good idea to review remote code \
before running, as a malicious actor could use a script like this to do naughty \
things on your computer.\n \
In this case, we are going to install the claut package, and (if necessary) a \
couple of packages that we need to install it.\n\n")
proceed <- readline(prompt = "Would you like to proceed? (y/N)")
if (proceed == "Y" || proceed == "y") {
helper <- c("devtools", "remotes") %in% rownames(installed.packages())
if (sum(helper) == 0) {
proceed <- readline(prompt = "We need devtools to install this package! Proceed? (y/N)")
if (proceed == "Y" || proceed == "y") {
install.packages("devtools", repos == "https://cloud.r-project.org/")
} else {
stop("Ok. Please install manually.")
}
} else if (sum(helper) >= 1){
if (helper[1]) {
devtools::install_git("https://gitlab.com/ConorIA/claut.git")
} else if (helper[2]) {
remotes::install_git("https://gitlab.com/ConorIA/claut.git")
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment