Get git commit SHA for use in command line utility

793 Views Asked by At

I want to run this command:

$ ionic-cloud build web --app-id=<APPFLOW APP ID> --commit=<GIT COMMIT SHA>

In order to do this I need to know my Git commit SHA. I know I can get this with:

git show -s --format=%H

Now how do I combine these things together to use in the command line? Should I make a shell script to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

If you want to include the output of the first command use:

ionic-cloud build web --app-id=<APPFLOW APP ID> --commit="$(git show -s --format=%H)"