summaryrefslogtreecommitdiff
path: root/bin/hstow
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hstow')
-rwxr-xr-xbin/hstow15
1 files changed, 5 insertions, 10 deletions
diff --git a/bin/hstow b/bin/hstow
index c7f783ed..b54b9c94 100755
--- a/bin/hstow
+++ b/bin/hstow
@@ -77,12 +77,6 @@ readlinks () {
rm "$fields_temp" "$targets_temp"
}
-disjoin_file () {
- while read -r line; do
- [ -n "$line" ] && printf "|$2" "$line"
- done <"$DIR/$1" | sed 's#^.##; s#/#\\/#g'
-}
-
globs_to_find_args () {
local file="$DIR/$1"; shift
printf '%s\n' "$@" | cat - $([ -e "$file" ] && echo "$file") \
@@ -135,13 +129,14 @@ stow1 () {
elif ! [ -e .hstow-always-adopt ]; then
adoptp=0
else
- # EREs matching files that (i) always/often have their symlinks
+ # Globs matching files that (i) always/often have their symlinks
# replaced with regular files when applications access them; and
# (ii) we don't ever want to edit the copy under $DIR directly,
# but only via the link/copy under $HOME.
- # We might list globs in this file & convert them to EREs here.
- adoptp="$(printf 'rel ~ /^(%s)/' \
- "$(disjoin_file .hstow-always-adopt "%s")")"
+ adoptp="$(printf \
+ 'rel ~ /%s/' \
+ "$(awk -f ~/src/dotfiles/lib-src/globs2ere.awk \
+ .hstow-always-adopt)")"
fi
find . $(globs_to_find_args .hstow-local-ignore ".git/*") \
! -name . ! -type d ! -name "$cchars" ! -name .gitignore \