| 1 |
$ . "$TESTDIR/helper.sh" |
| 2 |
> mkdir -p .dotfiles/hooks |
| 3 |
> echo 'echo Pre' > .dotfiles/hooks/pre-up |
| 4 |
> echo 'echo Post' > .dotfiles/hooks/post-up |
| 5 |
> chmod +x .dotfiles/hooks/pre-up |
| 6 |
> chmod +x .dotfiles/hooks/post-up |
| 7 |
> touch .example |
| 8 |
> touch .example-2 |
| 9 |
> touch .example-3 |
| 10 |
|
| 11 |
Making an rc file runs pre- and post-up hooks |
| 12 |
|
| 13 |
$ mkrc -v .example |
| 14 |
Moving... |
| 15 |
'*/.example' -> '*/.dotfiles/example' (glob) |
| 16 |
Linking... |
| 17 |
running pre-up hooks for */.dotfiles (glob) |
| 18 |
Pre |
| 19 |
'*/.dotfiles/example' -> '*/.example' (glob) |
| 20 |
running post-up hooks for */.dotfiles (glob) |
| 21 |
Post |
| 22 |
|
| 23 |
Avoids hooks by -K |
| 24 |
|
| 25 |
$ mkrc -K -v .example-2 |
| 26 |
Moving... |
| 27 |
'*/.example-2' -> '*/.dotfiles/example-2' (glob) |
| 28 |
Linking... |
| 29 |
'*/.dotfiles/example-2' -> '*/.example-2' (glob) |
| 30 |
|
| 31 |
Accepts -k for parity with rcup |
| 32 |
|
| 33 |
$ mkrc -k -v .example-3 |
| 34 |
Moving... |
| 35 |
'*/.example-3' -> '*/.dotfiles/example-3' (glob) |
| 36 |
Linking... |
| 37 |
running pre-up hooks for */.dotfiles (glob) |
| 38 |
Pre |
| 39 |
'*/.dotfiles/example-3' -> '*/.example-3' (glob) |
| 40 |
running post-up hooks for */.dotfiles (glob) |
| 41 |
Post |