Debian Codegraph @

test/rcup-hooks-run-in-order.t

raw
1 $ . "$TESTDIR/helper.sh"
2
3 Pre-up hooks should run in order according to their name
4
5 $ mkdir -p .dotfiles/hooks/pre-up .dotfiles/hooks/post-up
6 > printf "#!/bin/sh\necho '1'\n" > .dotfiles/hooks/pre-up/00-test.sh
7 > printf "#!/bin/sh\necho '2'\n" > .dotfiles/hooks/pre-up/01-test.sh
8 > printf "#!/bin/sh\necho '3'\n" > .dotfiles/hooks/pre-up/02-test.sh
9 > printf "#!/bin/sh\necho '4'\n" > .dotfiles/hooks/post-up/00-test.sh
10 > printf "#!/bin/sh\necho '5'\n" > .dotfiles/hooks/post-up/01-test.sh
11 > printf "#!/bin/sh\necho '6'\n" > .dotfiles/hooks/post-up/02-test.sh
12
13 $ chmod +x .dotfiles/hooks/pre-up/00-test.sh
14 > chmod +x .dotfiles/hooks/pre-up/01-test.sh
15 > chmod +x .dotfiles/hooks/pre-up/02-test.sh
16 > chmod +x .dotfiles/hooks/post-up/00-test.sh
17 > chmod +x .dotfiles/hooks/post-up/01-test.sh
18 > chmod +x .dotfiles/hooks/post-up/02-test.sh
19
20 $ rcup
21 1
22 2
23 3
24 4
25 5
26 6
27
28
29 Ensure that hooks run when output of lsrc is non-empty
30 $ touch .dotfiles/testrc
31 > rcup
32 1
33 2
34 3
35 4
36 5
37 6