From 88f6fc79013f6e6c6756b48b6edb842382ee87e2 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 29 Dec 2022 12:08:24 -0500 Subject: [PATCH] Include $file in hooks failure message --- share/rcm.sh.in | 2 +- test/rcup-hooks-failure.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/rcm.sh.in b/share/rcm.sh.in index c9b3994..47312d9 100644 --- a/share/rcm.sh.in +++ b/share/rcm.sh.in @@ -146,7 +146,7 @@ run_hooks() { hook_ret=$? if [ "$hook_ret" -ne 0 ]; then - echo "$when-$direction hook exited non-zero ($hook_ret)" >&2 + echo "$when-$direction hook $file exited non-zero ($hook_ret)" >&2 exit $hook_ret # NB. this only exits the while-read; caller must still check and exit fi done diff --git a/test/rcup-hooks-failure.t b/test/rcup-hooks-failure.t index d06e374..4d34fd0 100644 --- a/test/rcup-hooks-failure.t +++ b/test/rcup-hooks-failure.t @@ -11,5 +11,5 @@ Pre-up hooks failing should prevent rcup continuing $ rcup 1 - pre-up hook exited non-zero (7) + pre-up hook */.dotfiles/hooks/pre-up/00-test.sh exited non-zero (7) (glob) [7]