Created
January 12, 2017 13:17
-
-
Save jakub-g/17cb54694a72dd968dd4daf1f98b0832 to your computer and use it in GitHub Desktop.
node and npm from maven
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var path = require('path'); | |
// note this is required on maven BEFORE npm install so it can not be outsourced to ng-scripts | |
var execWithEnv = require('./execWithEnv'); | |
var exec = function(command) { | |
command = command + ' --no-color'; | |
var cwd = process.cwd(); | |
var customNodePath = path.join(__dirname, '../node'); | |
var customNpmPath = path.join(__dirname, '../node/maven-npm-bin'); | |
var PATH = [customNodePath, path.delimiter, customNpmPath, path.delimiter, process.env.PATH].join(''); | |
console.log('\n----------------------------------------------------------------------------'); | |
console.log('Running "' + command + '" in ' + cwd); | |
console.log('----------------------------------------------------------------------------'); | |
execWithEnv(command, { | |
PATH: PATH | |
}, { | |
verbose: false | |
}); | |
}; | |
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
var gitRoot = path.join(__dirname, '../'); | |
process.chdir(gitRoot); | |
exec('node --version'); | |
exec('npm install'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment