diff options
author | Mike Burns <mike@mike-burns.com> | 2014-03-28 14:44:45 +0100 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2014-03-28 15:17:38 +0100 |
commit | 9805390bda7bfe213770c525065e06b111143996 (patch) | |
tree | 56f9d0520263100024d0018fed52f2cd348f9d2c /share | |
parent | 082a22f0a0515f057abbd137b63411a545ce8c2f (diff) |
Only show hook filename when debugging
This uses a bit of a hack: if `$DEBUG` is set to `:`, then we are not in
debug mode.
Diffstat (limited to 'share')
-rw-r--r-- | share/rcm.sh.in | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/share/rcm.sh.in b/share/rcm.sh.in index 9f69e56..6d8a7e0 100644 --- a/share/rcm.sh.in +++ b/share/rcm.sh.in @@ -112,6 +112,7 @@ run_hooks() { local when="$1" local direction="$2" local hook_file + local find_opts= if [ $RUN_HOOKS -eq 1 ]; then for dotfiles_dir in $DOTFILES_DIRS; do @@ -119,7 +120,12 @@ run_hooks() { if [ -e "$hook_file" ]; then $VERBOSE "running $when-$direction hooks for $dotfiles_dir" - find "$hook_file" -type f -perm -111 -print -exec {} \; + + if [ x$DEBUG != x: ]; then + find_opts=-print + fi + + find "$hook_file" -type f -perm -111 $find_opts -exec {} \; else $DEBUG "no $when-$direction hook present for $dotfiles_dir, skipping" fi |