diff options
-rw-r--r-- | share/rcm.sh.in | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/share/rcm.sh.in b/share/rcm.sh.in index f6deccd..a5a7679 100644 --- a/share/rcm.sh.in +++ b/share/rcm.sh.in @@ -105,19 +105,20 @@ handle_metadata_flags() { run_hooks() { $DEBUG "run_hooks $1 $2" $DEBUG " with DOTFILES_DIRS: $DOTFILES_DIRS" - local when=$1 - local direction=$2 - local hook_file="$dotfiles_dir/hooks/$when-$direction" - - if [ ! -e "$hook_file" ]; then - $DEBUG "no $when-$direction hook file, skipping" - return 1 - fi + local when="$1" + local direction="$2" + local hook_file if [ $RUN_HOOKS -eq 1 ]; then for dotfiles_dir in $DOTFILES_DIRS; do - $VERBOSE "running $when-$direction hooks for $dotfiles_dir" - find "$hook_file" -type f -perm +111 -print -exec {} \; + hook_file="$dotfiles_dir/hooks/$when-$direction" + + if [ -e "$hook_file" ]; then + $VERBOSE "running $when-$direction hooks for $dotfiles_dir" + find "$hook_file" -type f -perm +111 -print -exec {} \; + else + $DEBUG "no $when-$direction hook present for $dotfiles_dir, skipping" + fi done fi } |