Skip to content

Commit

Permalink
Build Tooling: Pass individual files as arguments from watch to build…
Browse files Browse the repository at this point in the history
… script (#15219)
  • Loading branch information
aduth authored Apr 29, 2019
1 parent cafb57b commit 1e96ec7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/packages/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
const fs = require( 'fs' );
const watch = require( 'node-watch' );
const { execSync } = require( 'child_process' );
const { spawn } = require( 'child_process' );
const path = require( 'path' );
const chalk = require( 'chalk' );

Expand All @@ -12,7 +12,7 @@ const chalk = require( 'chalk' );
*/
const getPackages = require( './get-packages' );

const BUILD_CMD = `node \"${ path.resolve( __dirname, './build.js' ) }\"`;
const BUILD_SCRIPT = path.resolve( __dirname, './build.js' );

let filesToBuild = new Map();

Expand Down Expand Up @@ -69,7 +69,7 @@ setInterval( () => {
if ( files.length ) {
filesToBuild = new Map();
try {
execSync( `${ BUILD_CMD } \"${ files.join( ' ' ) }\"`, { stdio: [ 0, 1, 2 ] } );
spawn( 'node', [ BUILD_SCRIPT, ...files ], { stdio: [ 0, 1, 2 ] } );
} catch ( e ) {}
}
}, 100 );
Expand Down

0 comments on commit 1e96ec7

Please sign in to comment.