Skip to content

Commit e8a028c

Browse files
authored
fix: reject when command fails. perform commit with --no-verify (#40)
1 parent 283cb13 commit e8a028c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/updateVersion.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const cli = meow(
3737
const START_OF_LAST_RELEASE_PATTERN = /(^#+ \[?[0-9]+\.[0-9]+\.[0-9]+|<a name=)/m
3838
const HEADER = `# Changelog\n\nAll notable changes to this project will be documented in this file. See [Convential Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) for commit guidelines.\n\n`
3939

40-
const execPromise = (command) => new Promise((r) => exec(command, (e, out) => (e && r(e)) || r(out)))
40+
const execPromise = (command) =>
41+
new Promise((resolve, reject) => exec(command, (e, out) => (e && reject(e)) || resolve(out)))
4142

4243
const packageFile = JSON.parse(await readFile('./package.json', { encoding: 'utf-8' }))
4344
const isMonoRepo = !!packageFile.workspaces
@@ -182,7 +183,7 @@ if (!cli.flags.dryRun) {
182183
await execPromise(`git add */package.json`)
183184
}
184185

185-
await execPromise(`git commit -m "chore(release): v${nextVersion}"`)
186+
await execPromise(`git commit --no-verify -m "chore(release): v${nextVersion}"`)
186187

187188
// create tag
188189
await execPromise(`git tag v${nextVersion}`)

0 commit comments

Comments
 (0)