Update install script to avoid re-installing stuff unnecessarily.

parent 5b45b551
Pipeline #14348896 passed with stages
in 20 minutes and 12 seconds
if("git2r" %in% rownames(installed.packages()) == FALSE) {
install.packages("git2r", repos = "https://cloud.r-project.org/")
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")
}
}
}
if("remotes" %in% rownames(installed.packages()) == TRUE) {
remotes::install_github("r-lib/remotes")
} else {
source("https://raw.githubusercontent.com/r-lib/remotes/master/install-github.R")$value("r-lib/remotes")
}
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