summaryrefslogtreecommitdiff
path: root/share/rcm.sh.in
diff options
context:
space:
mode:
authorGravatar Pablo Olmos de Aguilera Corradini <pablo@glatelier.org>2013-09-15 16:50:02 -0300
committerGravatar Mike Burns <mike@mike-burns.com>2014-02-07 14:40:44 +0100
commit83c4875e23bb7595689ddd228a9825264b15f318 (patch)
treeac816ae59a46d5d1546cc501e664dffb77c56f2a /share/rcm.sh.in
parent3bdc2c7deaa50e7d9aedd05669299489f9bc7f71 (diff)
Allow {pre,post}-up hook directories
If the `pre-up` or `post-up` files are actually directories, run the executable contents of them in an arbitrary order.
Diffstat (limited to 'share/rcm.sh.in')
-rw-r--r--share/rcm.sh.in8
1 files changed, 3 insertions, 5 deletions
diff --git a/share/rcm.sh.in b/share/rcm.sh.in
index 7c0b6e2..c9a98b3 100644
--- a/share/rcm.sh.in
+++ b/share/rcm.sh.in
@@ -107,14 +107,12 @@ run_hooks() {
$DEBUG " with DOTFILES_DIRS: $DOTFILES_DIRS"
local when=$1
local direction=$2
+ local hook_file="$dotfiles_dir/hooks/$when-$direction"
if [ $RUN_HOOKS -eq 1 ]; then
for dotfiles_dir in $DOTFILES_DIRS; do
- $DEBUG "hook: $dotfiles_dir/hooks/$when-$direction"
- if [ -x "$dotfiles_dir/hooks/$when-$direction" ]; then
- $VERBOSE "running $when-$direction hooks for $dotfiles_dir"
- $dotfiles_dir/hooks/$when-$direction
- fi
+ $VERBOSE "running $when-$direction hooks for $dotfiles_dir"
+ find "$dotfiles_dir/hooks/$when-$direction" -type f -perm +111 -print -exec {} \;
done
fi
}