The rewrite introduced a slight bug with protected files. Fix that,
and rework the code slightly to make it obvious that we want a diff
set of options for files and dirs.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[[ -w ${path} ]] || die "Need write access to ${path}"
- # Do not traverse hidden directories such as .svn or .git.
- find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
if [[ ! -d ${path} ]] ; then
[[ ! -f ${path} ]] && continue
local my_basename="${path##*/}"
path="${path%/*}"
- find_opts+=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+ find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
+ else
+ # Do not traverse hidden directories such as .svn or .git.
+ find_opts=( -name '.*' -type d -prune -o -name '._cfg????_*' )
fi
find_opts+=( ! -name '.*~' ! -iname '.*.bak' -print )