Skip to content

Commit

Permalink
Update install_senamhiR.R [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorIA committed Sep 27, 2018
1 parent 4b74700 commit 6c7211b
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions install_senamhiR.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
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 senamhiR package, and a couple of \
packages that we need to install it.\n\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 remotes package and use it to install\
senamhiR.\n\n")

proceed <- readline(prompt = "Would you like to proceed? (y/N)")

if (proceed == "Y" || proceed == "y") {
if (!any(c("devtools", "remotes") %in% rownames(installed.packages()))) {
install.packages("devtools")
}
if("devtools" %in% rownames(installed.packages()) == TRUE) {
devtools::install_gitlab("ConorIA/senamhiR")
} else {
remotes::install_gitlab("ConorIA/senamhiR")
}
if (readline("Would you like to proceed? (y/N)") %in% c("Y", "y")) {
source("https://install-github.me/r-lib/remotes")
remotes::install_gitlab("ConorIA/senamhiR")
} else {
stop("Review the remote code and try again.")
}

0 comments on commit 6c7211b

Please sign in to comment.