Skip to content

Commit

Permalink
Add support for ignore-nothing env variable (#14)
Browse files Browse the repository at this point in the history
Ref #9 
Adds script support for `ignore-nothing` env var, and reorder logic
regarding the ignore patterns
  • Loading branch information
andrewvious authored Aug 7, 2024
1 parent 5ec0ead commit 6e809e1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nix-watch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,20 @@ let
fi
debug "Watching directory: ''${ANSI_BLUE}$WATCH_DIR''${ANSI_RESET}"
if [[ "$CLEAR" == false && -n "$NIX_WATCH_CLEAR" ]]; then
CLEAR=$(convert_int_to_bool $NIX_WATCH_CLEAR)
fi
if [[ "$IGNORE_NOTHING" == false && -n "$NIX_WATCH_IGNORE_NOTHING" ]]; then
IGNORE_NOTHING=$(convert_int_to_bool $NIX_WATCH_IGNORE_NOTHING)
fi
if [ "$IGNORE_NOTHING" == true ]; then
IGNORE_PATTERNS=()
fi
ignore_patterns="[''${IGNORE_PATTERNS[@]}]"
debug "The following patterns will be ignored: ''${ANSI_BLUE}$ignore_patterns''${ANSI_RESET}"
if [[ "$CLEAR" == false && -n "$NIX_WATCH_CLEAR" ]]; then
CLEAR=$(convert_int_to_bool $NIX_WATCH_CLEAR)
fi
if [[ "$DEBUG" == false && -n "$NIX_WATCH_DEBUG" ]]; then
DEBUG=$(convert_int_to_bool $NIX_WATCH_DEBUG)
fi
Expand Down

0 comments on commit 6e809e1

Please sign in to comment.