Debian Codegraph @

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

raw
1 $ . "$TESTDIR/helper.sh"
2
3 Pre-down and post-down hooks should run in order according to their name
4
5 $ mkdir -p .dotfiles/hooks/pre-down .dotfiles/hooks/post-down
6 > printf "#!/bin/sh\necho '1'\n" > .dotfiles/hooks/pre-down/00-test.sh
7 > printf "#!/bin/sh\necho '2'\n" > .dotfiles/hooks/pre-down/01-test.sh
8 > printf "#!/bin/sh\necho '3'\n" > .dotfiles/hooks/pre-down/02-test.sh
9 > printf "#!/bin/sh\necho '4'\n" > .dotfiles/hooks/post-down/00-test.sh
10 > printf "#!/bin/sh\necho '5'\n" > .dotfiles/hooks/post-down/01-test.sh
11 > printf "#!/bin/sh\necho '6'\n" > .dotfiles/hooks/post-down/02-test.sh
12
13 $ chmod +x .dotfiles/hooks/pre-down/00-test.sh
14 > chmod +x .dotfiles/hooks/pre-down/01-test.sh
15 > chmod +x .dotfiles/hooks/pre-down/02-test.sh
16 > chmod +x .dotfiles/hooks/post-down/00-test.sh
17 > chmod +x .dotfiles/hooks/post-down/01-test.sh
18 > chmod +x .dotfiles/hooks/post-down/02-test.sh
19
20 $ rcdn
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 > rcdn
32 1
33 2
34 3
35 4
36 5
37 6