Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Jul 26, 2020
1 parent e9cac85 commit d983b09
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @export
pre_release <- function(which = "patch", force = FALSE) {

state = check_pre_release_state(which = which, force = force)
state <- check_pre_release_state(which = which, force = force)

if (state) {
check_only_modified(character())
Expand Down Expand Up @@ -270,14 +270,14 @@ check_post_release <- function() {

ui_info("Checking contents of {ui_path('CRAN-RELEASE')}")
if (!file.exists("CRAN-RELEASE")) {
abort('File `CRAN-RELEASE` not found. Recreate with `devtools:::flag_release()`.')
abort("File `CRAN-RELEASE` not found. Recreate with `devtools:::flag_release()`.")
}

release <- paste(readLines("CRAN-RELEASE"), collapse = "\n")
rx <- "^.*[(]commit ([0-9a-f]+)[)].*$"
commit <- grepl(rx, release)
if (!commit) {
abort('Unexpected format of `CRAN-RELEASE` file. Recreate with `devtools:::flag_release()`.')
abort("Unexpected format of `CRAN-RELEASE` file. Recreate with `devtools:::flag_release()`.")
}
sha <- gsub(rx, "\\1", release)

Expand All @@ -298,6 +298,8 @@ check_post_release <- function() {

gh_scopes <- function() {
out <- attr(gh::gh("/user"), "response")$"x-oauth-scopes"
if (out == "") return(character())
if (out == "") {
return(character())
}
strsplit(out, ", *")[[1]]
}

0 comments on commit d983b09

Please sign in to comment.