-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exit if pre-up or pre-down hook exits non-zero
This allows scripts to bail early if a check fails.
- Loading branch information
1 parent
832e70b
commit 453e88b
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
|
||
Pre-down hooks failing should prevent rcdn continuing | ||
|
||
$ mkdir -p .dotfiles/hooks/pre-down | ||
> printf "#!/bin/sh\necho '1'\nexit 7\n" > .dotfiles/hooks/pre-down/00-test.sh | ||
> printf "#!/bin/sh\necho '2'\n" > .dotfiles/hooks/pre-down/01-test.sh | ||
|
||
$ chmod +x .dotfiles/hooks/pre-down/00-test.sh | ||
> chmod +x .dotfiles/hooks/pre-down/01-test.sh | ||
|
||
$ rcdn | ||
1 | ||
pre-down hook */.dotfiles/hooks/pre-down/00-test.sh exited non-zero (7) (glob) | ||
[7] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
|
||
Pre-up hooks failing should prevent rcup continuing | ||
|
||
$ mkdir -p .dotfiles/hooks/pre-up | ||
> printf "#!/bin/sh\necho '1'\nexit 7\n" > .dotfiles/hooks/pre-up/00-test.sh | ||
> printf "#!/bin/sh\necho '2'\n" > .dotfiles/hooks/pre-up/01-test.sh | ||
|
||
$ chmod +x .dotfiles/hooks/pre-up/00-test.sh | ||
> chmod +x .dotfiles/hooks/pre-up/01-test.sh | ||
|
||
$ rcup | ||
1 | ||
pre-up hook */.dotfiles/hooks/pre-up/00-test.sh exited non-zero (7) (glob) | ||
[7] |