Home > Net >  Get git commit SHA for use in command line utility
Get git commit SHA for use in command line utility

Time:04-30

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?

CodePudding user response:

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)"
  • Related