Get git commit in one line!
const gitCommit = process.env.GIT_COMMIT || require('child_process') | |
.spawnSync('git', ['rev-parse', '--short', 'HEAD'], { encoding: 'utf8' }) | |
.stdout.slice(0, -1) | |
console.log(gitCommit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment