forked from thoughtbot/rcm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run hooks on rcdn as indicated by the manpage
- Make sure IFS in rcup and rcdn isn't left in an incorrect state when the output of lsrc is empty. - Add tests to check that hooks run on rcdn and rcup by default.
- Loading branch information
1 parent
366dd72
commit 40bb6ef
Showing
5 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
|
||
Pre-down and post-down hooks should run by default | ||
|
||
$ mkdir -p .dotfiles/hooks | ||
> touch .dotfiles/hooks/pre-down .dotfiles/hooks/post-down | ||
> chmod +x .dotfiles/hooks/pre-down .dotfiles/hooks/post-down | ||
|
||
$ echo 'echo "example" > /tmp/test' > .dotfiles/hooks/pre-down | ||
> echo 'cat /tmp/test; rm /tmp/test' > .dotfiles/hooks/post-down | ||
|
||
$ rcdn | ||
example | ||
|
||
Ensure that hooks run when output of lsrc is non-empty | ||
$ touch .dotfiles/testrc | ||
> rcup | ||
> rcdn | ||
example |
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,18 @@ | ||
$ . "$TESTDIR/helper.sh" | ||
|
||
Pre-up and post-up hooks should run by default | ||
|
||
$ mkdir -p .dotfiles/hooks | ||
> touch .dotfiles/hooks/pre-up .dotfiles/hooks/post-up | ||
> chmod +x .dotfiles/hooks/pre-up .dotfiles/hooks/post-up | ||
|
||
$ echo 'echo "example" > /tmp/test' > .dotfiles/hooks/pre-up | ||
> echo 'cat /tmp/test; rm /tmp/test' > .dotfiles/hooks/post-up | ||
|
||
$ rcup | ||
example | ||
|
||
Ensure that hooks run when output of lsrc is non-empty | ||
$ touch .dotfiles/testrc | ||
> rcup | ||
example |