From b2f9d5963e28136f672e2453f4876e4a06ac1f5c Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 2 Aug 2017 17:23:06 -0500 Subject: [PATCH] Move submit check to submit_cran() Fixes #1228 --- NEWS.md | 3 +++ R/release.r | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 38b5254f8..5bca9b034 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # devtools 1.13.3.9000 +* `submit_cran()` now checks that you're ready to submit, since this is a + potentially expensive operation (#1228) + * `check()` defaults to running `document()` only if you have used roxygen previously (#1437). diff --git a/R/release.r b/R/release.r index 5c63f3e0c..b15c13aed 100644 --- a/R/release.r +++ b/R/release.r @@ -131,11 +131,7 @@ release <- function(pkg = ".", check = TRUE, args = NULL, spelling = "en_US") { if (yesno("Is your email address ", maintainer(pkg)$email, "?")) return(invisible()) - built_path <- build_cran(pkg, args = args) - if (yesno("Ready to submit?")) - return(invisible()) - - upload_cran(pkg, built_path) + submit_cran(pkg, args = args) if (uses_git(pkg$path)) { message("Don't forget to tag the release when the package is accepted!") @@ -266,6 +262,10 @@ cran_submission_url <- "http://xmpalantir.wu.ac.at/cransubmit/index2.php" #' @export #' @keywords internal submit_cran <- function(pkg = ".", args = NULL) { + if (yesno("Ready to submit to CRAN?")) + return(invisible()) + + pkg <- as.package(pkg) built_path <- build_cran(pkg, args = args) upload_cran(pkg, built_path) }