minimal/do: handle nonzero exit codes and set $1/$2 correctly.
Also add some tests to confirm this.
This commit is contained in:
parent
c7585558ef
commit
b9853d3858
6 changed files with 27 additions and 8 deletions
2
t/.gitignore
vendored
2
t/.gitignore
vendored
|
|
@ -4,3 +4,5 @@ c.c.c
|
|||
c.c.c.b
|
||||
c.c.c.b.b
|
||||
d
|
||||
test.args
|
||||
test2.args
|
||||
|
|
|
|||
2
t/all.do
2
t/all.do
|
|
@ -1,3 +1,3 @@
|
|||
redo-ifchange hello yellow bellow c d deltest deltest2
|
||||
redo-ifchange hello yellow bellow c d
|
||||
|
||||
|
||||
|
|
|
|||
3
t/default.args.do
Normal file
3
t/default.args.do
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[ "$1" = "test" ]
|
||||
[ "$2" = ".args" ]
|
||||
[ "$3" != "test.args" ]
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
redo-ifchange all
|
||||
./hello >&2
|
||||
redo deltest deltest2 test.args test2.args
|
||||
|
|
|
|||
3
t/test2.args.do
Normal file
3
t/test2.args.do
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[ "$1" = "test2.args" ]
|
||||
[ "$2" = "" ]
|
||||
[ "$3" != "test2.args" ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue