jeudi 20 septembre 2018

How to handle failing command in Makefile?

How can I handle a failing command or command that output an error in Makefile?

for example

lambda: 
    aws lambda create-function \
        --region $(AWS_REGION) \
        ...
    # the aws command above will output an error that function is already exist and stop the make process
    # need to put an if-statement when error happens, then run this command to update the function.
    aws lambda update-function-code \
        --region $(AWS_REGION) \
        ...

Thank you very much in advance

Aucun commentaire:

Enregistrer un commentaire