File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,10 @@ need to install dependencies which are only necessary for the release.
141
141
142
142
Defines new properties and methods to add to the ` Release ` object.
143
143
144
- #### abort( msg )
144
+ #### abort( msg [ , error ] )
145
145
146
- Aborts the release and prints the message.
146
+ Aborts the release and prints the message. If an error object is provided, it is
147
+ used for the stack trace, otherwise the current call stack is used.
147
148
148
149
#### exec( command, options )
149
150
Original file line number Diff line number Diff line change @@ -29,12 +29,17 @@ Release.define({
29
29
process . chdir ( directory ) ;
30
30
} ,
31
31
32
- abort : function ( msg ) {
33
- var error = new Error ( ) ;
34
- Error . captureStackTrace ( error ) ;
32
+ abort : function ( msg , error ) {
33
+ if ( ! error ) {
34
+ error = new Error ( msg ) ;
35
+ Error . captureStackTrace ( error , Release . abort ) ;
36
+ }
37
+
35
38
console . log ( msg . red ) ;
36
39
console . log ( "Aborting." . red ) ;
40
+ console . log ( ) ;
37
41
console . log ( error . stack ) ;
42
+
38
43
process . exit ( 1 ) ;
39
44
} ,
40
45
You can’t perform that action at this time.
0 commit comments