Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue make command even if one operation within fails [duplicate]

I'm looking for a way to continue a make command in the event of a error failure.

I need a way of wrapping a command so it doesn't respond with a exit code 1.

test:
    exit 1 ;\
    echo 'hi' ;\

I need a way to wrap something like this:

example:
   somecommand && othercommand ;\
   echo 'hi' ;\

Where somecommand can exit with a 1 (error) and not run othercommand or a 0 which would run othercommand.

like image 873
ThomasReggi Avatar asked Oct 27 '25 20:10

ThomasReggi


1 Answers

Prefixing a recipe with - tells make to ignore any errors returned by that line, the only other thing you need to do is run the two recipes separately.

example:
   -somecommand && othercommand
   echo 'hi'
like image 180
user657267 Avatar answered Oct 29 '25 17:10

user657267



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!