mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 12:42:09 +00:00

PR-URL: https://github.com/nodejs/node/pull/38254 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
18 lines
425 B
JavaScript
18 lines
425 B
JavaScript
const git = require('@npmcli/git')
|
|
|
|
module.exports = (version, opts) => {
|
|
const { commitHooks, allowSameVersion, signGitCommit, message } = opts
|
|
const args = ['commit']
|
|
if (commitHooks === false) {
|
|
args.push('-n')
|
|
}
|
|
if (allowSameVersion) {
|
|
args.push('--allow-empty')
|
|
}
|
|
if (signGitCommit) {
|
|
args.push('-S')
|
|
}
|
|
args.push('-m')
|
|
return git.spawn([...args, message.replace(/%s/g, version)], opts)
|
|
}
|