我正在尝试在谷歌云平台上增加我的包的版本一个 R 会话。我想我一定遗漏了一些东西,因为我认为何时which
设置代码应该能够在没有进一步用户输入的情况下运行。
rlang::is_interactive()
FALSE
如我所料返回。
usethis::use_version(which = "minor")
✔ Setting active project to '/home/jupyter/x/y'
Error: User input required, but session is not interactive.
Query: There are uncommitted changes and you're about to bump version
Do you want to proceed anyway?
Traceback:
1. usethis::use_version("minor")
2. challenge_uncommitted_changes(msg = "There are uncommitted changes and you're about to bump version")
3. ui_yeah("{msg}\nDo you want to proceed anyway?")
4. ui_stop(c("User input required, but session is not interactive.",
. "Query: {x}"))
这是功能代码:https ://github.com/r-lib/usethis/blob/master/R/version.R
function (which = NULL)
{
if (is.null(which) && !is_interactive()) {
return(invisible(FALSE))
}
check_is_package("use_version()")
challenge_uncommitted_changes(msg = "There are uncommitted changes and you're about to bump version")
new_ver <- choose_version("What should the new version be?",
which)
if (is.null(new_ver)) {
return(invisible(FALSE))
}
use_description_field("Version", new_ver, overwrite = TRUE)
if (names(new_ver) == "dev") {
use_news_heading("(development version)")
}
else {
use_news_heading(new_ver)
}
use_c_version(new_ver)
git_ask_commit("Increment version number", untracked = TRUE,
paths = c("DESCRIPTION", "NEWS.md", path("src", "version.c")))
invisible(TRUE)
}
这是choose_version() 中可能存在的错误吗?
R版
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 6.3
year 2020
month 02
day 29
svn rev 77875
language R
version.string R version 3.6.3 (2020-02-29)
nickname Holding the Windsock