Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var spawn = require( 'child_process' ).spawn;
* @param {Error} error - error object
*/
function onError( error ) {
proc.exitCode = 1;
process.exitCode = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The right fix here is to add the missing import rather than switching to the process global.

If you look at every other sibling makie plugin (e.g., makie-test, makie-benchmark, makie-examples -- all 21 of them), they all have this at line 23:

var proc = require( 'process' );
var spawn = require( 'child_process' ).spawn;

This file is the only one missing that require( 'process' ) import. That's the actual root cause of the lint error.

The fix should be to add var proc = require( 'process' ); before the spawn require (line 23) and then revert all four callback changes back to using proc. This keeps consistency with every other plugin in this directory and follows the stdlib convention of using require('process') rather than relying on the process global.

console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
}

Expand All @@ -45,7 +45,7 @@ function onError( error ) {
*/
function onFinish( code ) {
if ( code !== 0 ) {
proc.exitCode = code;
process.exitCode = code;
return console.error( 'Child process exited with code `'+code + '`.' ); // eslint-disable-line no-console
}
}
Expand All @@ -57,7 +57,7 @@ function onFinish( code ) {
* @param {Buffer} data - standard output
*/
function stdout( data ) {
proc.stdout.write( data );
process.stdout.write( data );
}

/**
Expand All @@ -67,7 +67,7 @@ function stdout( data ) {
* @param {Buffer} data - standard error
*/
function stderr( data ) {
proc.stderr.write( data );
process.stderr.write( data );
}


Expand Down
Loading