task ‘run’, {
run ‘false’; # FAIL!!!
}
task ‘finish’ => ‘run’, {
say ‘finish’
}
Try sake finish.
Some would argue that using run without checking the result is wrong. However, a typical makefile can have a lot of calls to other commands, and writing a check for each of them is probably an overkill given that failed procs will blow up in sink context anyway. But there is one issue which is demonstrated above. The last statement will be returned from the block, so it fails silently. It can be easily fixed by writing something like:
task ‘run’, {
run ‘false’; # FAIL!!!
True # ← make sure we are not sinking our proc
}
But I think that Sake can do something to prevent this trap.
Let's say we have these tasks:
Try
sake finish
. Some would argue that usingrun
without checking the result is wrong. However, a typical makefile can have a lot of calls to other commands, and writing a check for each of them is probably an overkill given that failed procs will blow up in sink context anyway. But there is one issue which is demonstrated above. The last statement will be returned from the block, so it fails silently. It can be easily fixed by writing something like:But I think that Sake can do something to prevent this trap.