$ ./bad.sh
.tup repository initialized: .tup/db
[ tup ] [0.005s] Scanning filesystem...
[ tup ] [0.010s] Reading in new environment variables...
[ tup ] [0.014s] Parsing Tupfiles...
0) [0.004s] .
[ ] 100%
[ tup ] [0.023s] No files to delete.
[ tup ] [0.028s] Executing Commands...
[ ] 0%/home/username/tmp/tup/cache/cache.txt: No such file or directory
* 0) mkdir -p cache && echo hi > cache/cache.txt && false
*** tup messages ***
*** Command ID=13 failed with return value 1
tup error: Unable to rename temporary file '.tup/tmp/0' to destination '/home/username/tmp/tup/cache/cache.txt'
[ ] 100%
*** tup: 1 job failed.
Apart from the tup error: Unable to rename temporary file ... and No such file or directory errors, there is also a major problem in that the cache/cache.txt file doesn't get generated as I expected (even though the command failed).
This prevents the cache file from being reused when the command runs the next time (and, in my real-world case, means that the command runs very slowly).
This script works as expected:
However, this very similar one doesn't (the only difference between them is the command ends in
&& false
in the one below):Apart from the
tup error: Unable to rename temporary file ...
andNo such file or directory
errors, there is also a major problem in that thecache/cache.txt
file doesn't get generated as I expected (even though the command failed).This prevents the cache file from being reused when the command runs the next time (and, in my real-world case, means that the command runs very slowly).