codekingpro/portable-devtools
115k
1const git = require('@npmcli/git')
2
3module.exports = (version, opts) => {
4 const { commitHooks, allowSameVersion, signGitCommit, message } = opts
5 const args = ['commit']
6 if (commitHooks === false) {
7 args.push('-n')
8 }
9 if (allowSameVersion) {
10 args.push('--allow-empty')
11 }
12 if (signGitCommit) {
13 args.push('-S')
14 }
15 args.push('-m')
16 return git.spawn([...args, message.replace(/%s/g, version)], opts)
17}
18 