File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,6 @@ var COMMANDS = require( './cli_commands.json' );
3434
3535// FUNCTIONS //
3636
37- /**
38- * Callback invoked upon encountering an error while running a command.
39- *
40- * @private
41- * @param {Error } error - error object
42- */
43- function onError ( error ) {
44- process . exitCode = 1 ;
45- console . error ( 'Error: %s' , error . message ) ; // eslint-disable-line no-console
46- }
47-
4837/**
4938* Returns command information.
5039*
@@ -153,6 +142,17 @@ function main() {
153142 // Invoke the command in a sub-process:
154143 proc = spawn ( 'node' , subargs , opts ) ;
155144 proc . on ( 'error' , onError ) ;
145+
146+ /**
147+ * Callback invoked upon encountering an error while running a command.
148+ *
149+ * @private
150+ * @param {Error } error - error object
151+ */
152+ function onError ( error ) {
153+ console . error ( 'Error: %s' , error . message ) ; // eslint-disable-line no-console
154+ cli . exit ( 1 ) ;
155+ }
156156}
157157
158158main ( ) ;
You can’t perform that action at this time.
0 commit comments