Skip to content

Commit

Permalink
user testing of app showed this
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed Sep 2, 2021
1 parent f73368b commit 23e72b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions R/cron_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
#' @export
cron_load <- function(file, user="", ask=TRUE) {
stopifnot(is.character(file) && file.exists(file))
cat(sep="", "Are you sure you want to load the cron jobs available at '", file, "'? [y/n]: ")
input <- tolower(scan(what=character(), n=1, quiet=TRUE))
if (!input %in% "y") {
message("No action taken.")
return(invisible())
if(ask){
cat(sep="", "Are you sure you want to load the cron jobs available at '", file, "'? [y/n]: ")
input <- tolower(scan(what=character(), n=1, quiet=TRUE))
if (!input %in% "y") {
message("No action taken.")
return(invisible())
}
}
if (user == "") {
system(paste("crontab", file))
Expand Down

0 comments on commit 23e72b0

Please sign in to comment.