Skip to content

Commit

Permalink
fix is_ignored() cc @krlmlr
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Aug 28, 2020
1 parent 61206f6 commit 8f024e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions R/auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,22 @@ gh_scopes <- function() {
strsplit(out, ", *")[[1]]
}

check_gitignore <- function(files) {
is_ignored <- map_lgl(files, is_ignored)

if (any(is_ignored)) {
files_ignored <- files[is_ignored]
cli::cli_alert_warning("The following files are listed in {.file .gitignore}:")
cli::cli_ul("{files_ignored}")
cli::cli_text("Certain {.pkg fledge} automation steps might fail due to this.")
abort(paste0("Remove ", glue_collapse(files_ignored, ", "), " from .gitignore."))
}
}

is_ignored <- function(path) {
system2("git", c("check-ignore", "-q", path), stdout = FALSE) != 1
}

create_pr <- function(release_branch, main_branch, remote_name) {
info <- github_info(remote = remote_name)
gh::gh("POST /repos/:owner/:repo/pulls",
Expand Down

3 comments on commit 8f024e2

@krlmlr
Copy link
Contributor

@krlmlr krlmlr commented on 8f024e2 Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code removed?

@pat-s
Copy link
Contributor Author

@pat-s pat-s commented on 8f024e2 Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change was from == 1 to != 1?

@krlmlr
Copy link
Contributor

@krlmlr krlmlr commented on 8f024e2 Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why this patch only adds new code.

Please sign in to comment.