This commit is contained in:
Joao Moreno
2017-06-26 15:15:54 +02:00
parent ca59971278
commit f7aac1ba7e
2 changed files with 22 additions and 24 deletions

View File

@@ -4,13 +4,15 @@
*--------------------------------------------------------------------------------------------*/
const cp = require('child_process');
const path = require('path');
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
function npmInstall(location) {
const result = cp.spawnSync(npm, ['install'], {
cwd: location ,
stdio: 'inherit'
});
function npmInstall(location, opts) {
opts = opts || {};
opts.cwd = location;
opts.stdio = 'inherit';
const result = cp.spawnSync(npm, ['install'], opts);
if (result.error || result.status !== 0) {
process.exit(1);
@@ -43,4 +45,17 @@ const extensions = [
extensions.forEach(extension => npmInstall(`extensions/${extension}`));
npmInstall(`build`); // node modules required for build
function npmInstallBuildDependencies() {
// make sure we install gulp watch for the system installed
// node, since that is the driver of gulp
const env = Object.assign({}, process.env);
delete env['npm_config_disturl'];
delete env['npm_config_target'];
delete env['npm_config_runtime'];
npmInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env });
}
npmInstall(`build`); // node modules required for build
npmInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron