From 9805390bda7bfe213770c525065e06b111143996 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Fri, 28 Mar 2014 14:44:45 +0100 Subject: 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. --- share/rcm.sh.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'share/rcm.sh.in') 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 -- cgit v1.2.3