Skip to content

Commit 429d520

Browse files
committed
feat: allow run-if to accept --sha argument for #12
1 parent e01031a commit 429d520

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bin/commit-message-run.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ const debug = require('debug')('commit-message-install')
1717
const allArgs = process.argv.slice(2)
1818
const args = require('minimist')(allArgs, {
1919
alias: {
20-
file: 'f'
20+
file: 'f',
21+
sha: 'commit'
2122
},
22-
string: 'file'
23+
string: ['file', 'sha']
2324
})
2425

2526
const api = require('..')
@@ -43,7 +44,7 @@ if (args.file) {
4344
const message = fs.readFileSync(args.file, 'utf8')
4445
start = Promise.resolve(message)
4546
} else {
46-
start = getMessage()
47+
start = getMessage(args.sha)
4748
}
4849
start
4950
.then(getJsonBlock)

0 commit comments

Comments
 (0)