mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Prevent command from running if "pre" hook fails
This commit is contained in:
parent
f73c873681
commit
61270c8277
9
yadm
9
yadm
@ -892,6 +892,15 @@ function invoke_hook() {
|
|||||||
export YADM_HOOK_WORK
|
export YADM_HOOK_WORK
|
||||||
|
|
||||||
"$hook_command"
|
"$hook_command"
|
||||||
|
hook_status=$?
|
||||||
|
|
||||||
|
#; failing "pre" hooks will prevent commands from being run
|
||||||
|
if [ "$mode" = "pre" ] && [ "$hook_status" -ne 0 ]; then
|
||||||
|
echo "Hook $hook_command was not successful"
|
||||||
|
echo "$HOOK_COMMAND will not be run"
|
||||||
|
exit "$hook_status"
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user