Skip to content

Commit 52816cc

Browse files
committed
fix: throw on exec error, fix #67
1 parent b9f797f commit 52816cc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/git.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function gitCommit(operation: Operation): Promise<Operation> {
3535
if (!all)
3636
args = args.concat(updatedFiles)
3737

38-
await x('git', ['commit', ...args])
38+
await x('git', ['commit', ...args], { throwOnError: true })
3939

4040
return operation.update({ event: ProgressEvent.GitCommit, commitMessage })
4141
}
@@ -69,7 +69,7 @@ export async function gitTag(operation: Operation): Promise<Operation> {
6969
args.push('--sign')
7070
}
7171

72-
await x('git', ['tag', ...args])
72+
await x('git', ['tag', ...args], { throwOnError: true })
7373

7474
return operation.update({ event: ProgressEvent.GitTag, tagName })
7575
}
@@ -82,11 +82,11 @@ export async function gitPush(operation: Operation): Promise<Operation> {
8282
return operation
8383

8484
// Push the commit
85-
await x('git', ['push'])
85+
await x('git', ['push'], { throwOnError: true })
8686

8787
if (operation.options.tag) {
8888
// Push the tag
89-
await x('git', ['push', '--tags'])
89+
await x('git', ['push', '--tags'], { throwOnError: true })
9090
}
9191

9292
return operation.update({ event: ProgressEvent.GitPush })

src/version-bump.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export async function versionBump(arg: (VersionBumpOptions) | string = {}): Prom
8080
const [command, ...args] = tokenizeArgs(operation.options.execute)
8181
console.log(symbols.info, 'Executing script', command, ...args)
8282
await x(command, args, {
83+
throwOnError: true,
8384
nodeOptions: {
8485
stdio: 'inherit',
8586
cwd: operation.options.cwd,

0 commit comments

Comments
 (0)