I am in a situation where I want to do something is a target returns error. My code is:
pre-submit:
cp test.csv test.csv.bk
make test.csv
make lint
rm test.csv.bk
This run just fine. But there can be cases when make lint
or make test.csv
through an error and in that case I want to remove test.csv
(if any) and rename test.csv.bk
to test.csv
I couldn't find if we can catch error raised from target
Edit: lint looks like this:
.PHONY: lint
lint: | env
./env/bin/python lint.py