Skip to content

Commit

Permalink
Clarify choose_version() prompt for use_release_issue() (r-lib#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmbarrett authored Feb 9, 2021
1 parent 762daec commit cefd16a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use_release_issue <- function(version = NULL) {
}
}

version <- version %||% choose_version()
version <- version %||% choose_version("What should the release version be?")
if (is.null(version)) {
return(invisible(FALSE))
}
Expand Down
7 changes: 4 additions & 3 deletions R/version.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use_version <- function(which = NULL) {
msg = "There are uncommitted changes and you're about to bump version"
)

new_ver <- choose_version(which)
new_ver <- choose_version("What should the new version be?", which)
if (is.null(new_ver)) {
return(invisible(FALSE))
}
Expand Down Expand Up @@ -75,7 +75,7 @@ use_dev_version <- function() {
use_version(which = "dev")
}

choose_version <- function(which = NULL) {
choose_version <- function(message, which = NULL) {
ver <- desc::desc_get_version(proj_get())
versions <- bump_version(ver)

Expand All @@ -85,7 +85,8 @@ choose_version <- function(which = NULL) {
"{format(names(versions), justify = 'right')} --> {versions}"
),
title = glue(
"Current version is {ver}.\n", "Which part to increment? (0 to exit)"
"Current version is {ver}.\n",
"{message} (0 to exit)"
)
)
if (choice == 0) {
Expand Down

0 comments on commit cefd16a

Please sign in to comment.