Skip to content

Instantly share code, notes, and snippets.

@josherrickson
Last active May 18, 2022 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josherrickson/17c9edbd5d4f820d65455ba4ff46e6d0 to your computer and use it in GitHub Desktop.
Save josherrickson/17c9edbd5d4f820d65455ba4ff46e6d0 to your computer and use it in GitHub Desktop.
a more sane `devtools:::yesno`
suppressMessages(require(devtools))
yesno <- function(...) {
cat(paste0(..., collapse = ""))
# For whatever reason, devtools:::yesno returns `TRUE` if you select a No
# option, and `FALSE` if you select a Yes option
utils::menu(c("Yes", "No")) != 1
}
utils::assignInNamespace("yesno", yesno, "devtools")
# remove stand-alone `yesno`
rm(yesno)
@josherrickson
Copy link
Author

Insert this into your .Rprofile to overwrite devtools:::yesno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment