diff --git a/bootstrap/autostow.sh b/bootstrap/autostow.sh index cbe0482..b7dd038 100755 --- a/bootstrap/autostow.sh +++ b/bootstrap/autostow.sh @@ -83,7 +83,10 @@ dryrun() { is_ignored() { IFS=":" for ign in $ignore; do - if [ "$ign" == "$1" ] || [ "$ign/" == "$1" ]; then + # it is either passed in through our environment variable + # or it starts with a _ which is ignored by default (that's the regex). + # (using herestring to avoid cat>grep) + if [ "$ign" = "$1" ] || [ "$ign/" = "$1" ] || grep -q -e '^_[[:alnum:]]\{1,\}' <<<"$1"; then return 0 fi done @@ -115,7 +118,9 @@ usage() { "" \ " -n | --dry-run Do not invoke any operation but print out directories affected, simulating a dry-run." \ "" \ - " -d Remove dotfiles, by unlinking any directory found next to stow.sh using GNU stow." \ + " Note, by default any directory starting with an underscore _directoryname will be ignored." \ + " Additional folders to ignore can be set through the environment variable AUTOSTOW_IGNORED_DIRS " \ + " using a colon-separated string: AUTOSTOW_IGNORED_DIRS=\"directories:to:ignore\" " \ "" \ "" }