Skip to content

Commit

Permalink
Use globs
Browse files Browse the repository at this point in the history
- Use globs for ignored files (fixes some edge cases)
  • Loading branch information
ElianHugh committed Jun 7, 2024
1 parent 4d7dc43 commit 0ec377f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ new_engine <- function(path, dirs, port, host, ignore) {
dirs = dirs,
host = host %||% "127.0.0.1",
ignore = ignore %||% c("*.sqlite", "*.git*") |>
paste0(collapse = "|")
paste0(collapse = "|") |>
utils::glob2rx()
),
publisher = nanonext::socket(
protocol = "pub",
Expand Down
2 changes: 1 addition & 1 deletion R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @param dirs extra directories to watch
#' @param port port to launch API on, defaults to `httpuv::randomPort()`
#' @param host host to launch API on, defaults to "127.0.0.1"
#' @param ignore vector of files or file extensions to ignore (regex patterns)
#' @param ignore vector of files or file extensions to ignore (globs)
#'
#' @examples
#' \dontrun{
Expand Down
1 change: 0 additions & 1 deletion R/watcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ get_changed_files <- function(current_state, next_state) {
new <- names(next_state[names(next_state) %nin% names(current_state)])
removed <- names(current_state[names(current_state) %nin% names(next_state)])
modified <- names(next_state[next_state %nin% current_state])

unique(c(new, removed, modified))
}

Expand Down

0 comments on commit 0ec377f

Please sign in to comment.