From: Ian Kelling Date: Sat, 7 May 2016 22:00:55 +0000 (-0700) Subject: ignore .git in subdir linking X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=541351661b0019ffae42ee83a9e3a69e306f93bd ignore .git in subdir linking --- diff --git a/conflink b/conflink index ddf9901..e263e06 100755 --- a/conflink +++ b/conflink @@ -11,6 +11,7 @@ sysv() { shopt -s nullglob +shopt -s extglob # if we make a link back to the root, traversing the subdirs stops. # This makes it so we can do subdir directories. Must call with absolute @@ -20,9 +21,9 @@ subdir-link-r() { local root="$1" local targets=() if [[ $2 ]]; then - targets=( "$2"/* ) + targets=( "$2"/!(.git) ) else - for f in "$1"/*; do + for f in "$1"/!(.git); do [[ -d $f ]] && targets+=("$f") ||: done fi