File tree 2 files changed +11
-25
lines changed
2 files changed +11
-25
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ let timer
23
23
let current
24
24
25
25
// Output a command to the terminal and execute it.
26
- function run ( cmd , treatStderrAsFailure = true ) {
27
- capture ( cmd , treatStderrAsFailure )
26
+ function run ( cmd ) {
27
+ capture ( cmd )
28
28
}
29
29
30
30
// Ask a question in terminal and return the response.
@@ -55,7 +55,7 @@ function checkpoint (question) {
55
55
}
56
56
57
57
// Run a command and capture its output to return it to the caller.
58
- function capture ( cmd , treatStderrAsFailure = true ) {
58
+ function capture ( cmd ) {
59
59
if ( flags . debug ) {
60
60
log ( `${ GRAY } > ${ cmd } ${ RESET } ` )
61
61
}
@@ -76,25 +76,11 @@ function capture (cmd, treatStderrAsFailure = true) {
76
76
77
77
if ( flags . debug ) {
78
78
log ( stdout )
79
- if ( stderr ) {
80
- if ( flags [ 'no-abort-on-error' ] ) {
81
- log ( `${ RED } ${ stderr } ${ RESET } ` )
82
- } else {
83
- fatal (
84
- stderr ,
85
- 'Aborting due to error! Use --no-abort-on-error to ignore and continue.'
86
- )
87
- }
88
- }
89
- } else if ( treatStderrAsFailure && stderr ) {
90
- if ( flags [ 'no-abort-on-error' ] ) {
91
- log ( `${ RED } ${ stderr } ${ RESET } ` )
92
- } else {
93
- fatal (
94
- stderr ,
95
- 'Aborting due to error! Use --no-abort-on-error to ignore and continue.'
96
- )
97
- }
79
+ log ( `${ RED } ${ stderr } ${ RESET } ` )
80
+ }
81
+
82
+ if ( result . status ) {
83
+ throw new Error ( stderr )
98
84
}
99
85
100
86
return stdout
Original file line number Diff line number Diff line change 82
82
83
83
try {
84
84
// Pull latest changes in case the release was started by someone else.
85
- run ( `git remote show origin | grep v${ newVersion } && git pull --ff-only` , false )
85
+ run ( `git remote show origin | grep v${ newVersion } && git pull --ff-only` )
86
86
} catch ( e ) {
87
87
// Either there is no remote to pull from or the local and remote branches
88
88
// have diverged. In both cases we ignore the error and will just use our
@@ -113,7 +113,7 @@ try {
113
113
114
114
// Cherry pick all new commits to the proposal branch.
115
115
try {
116
- run ( `echo "${ proposalDiff } " | xargs git cherry-pick` , false )
116
+ run ( `echo "${ proposalDiff } " | xargs git cherry-pick` )
117
117
118
118
pass ( )
119
119
} catch ( err ) {
@@ -147,7 +147,7 @@ try {
147
147
148
148
// Create or edit the PR. This will also automatically output a link to the PR.
149
149
try {
150
- run ( `gh pr create -d -B v${ releaseLine } .x -t "v${ newVersion } proposal" -F ${ notesFile } ` , false )
150
+ run ( `gh pr create -d -B v${ releaseLine } .x -t "v${ newVersion } proposal" -F ${ notesFile } ` )
151
151
} catch ( e ) {
152
152
// PR already exists so update instead.
153
153
// TODO: Keep existing non-release-notes PR description if there is one.
You can’t perform that action at this time.
0 commit comments