Move install script to bin/install-node.js

This commit is contained in:
Juan Cruz Viotti 2015-02-13 15:18:24 -04:00
parent 5226e7db16
commit 16544e41a9
2 changed files with 18 additions and 1 deletions

17
bin/install-node.js Normal file
View File

@ -0,0 +1,17 @@
var binary = require('node-binary');
var nodeVersion = 'v0.12.0';
console.log('Downloading node-' + nodeVersion + '-' + process.platform + '-' + process.arch);
binary.download({
os: process.platform,
arch: process.arch,
version: nodeVersion
}, './bin/node', function(error, binaryPath) {
if(error) {
console.error(error.message);
process.exit(1);
}
console.log('NodeJS was downloaded to ' + binaryPath);
});

View File

@ -19,7 +19,7 @@
"scripts": {
"prepublish": "gulp build",
"test": "gult test",
"install": "node-binary download v0.12.0 ./bin/node --arch `node -e 'console.log(process.arch)'` --os `node -e 'console.log(process.platform)'`"
"install": "node bin/install-node.js"
},
"keywords": [
"resin",