summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/rcm.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/rcm.sh.in b/share/rcm.sh.in
index 3260cd4..f6deccd 100644
--- a/share/rcm.sh.in
+++ b/share/rcm.sh.in
@@ -109,10 +109,15 @@ run_hooks() {
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
+
if [ $RUN_HOOKS -eq 1 ]; then
for dotfiles_dir in $DOTFILES_DIRS; do
$VERBOSE "running $when-$direction hooks for $dotfiles_dir"
- find "$dotfiles_dir/hooks/$when-$direction" -type f -perm +111 -print -exec {} \;
+ find "$hook_file" -type f -perm +111 -print -exec {} \;
done
fi
}