diff --git a/bin/install-node.js b/bin/install-node.js index 6ccf0ed0..7e4f41da 100644 --- a/bin/install-node.js +++ b/bin/install-node.js @@ -4,11 +4,14 @@ var path = require('path'); var nodeVersion = require('../package.json').bundled_engine; var destination = './bin/node'; -console.log('Downloading node-' + nodeVersion + '-' + process.platform + '-' + process.arch); +var os = process.env.RESIN_OS || process.platform; +var arch = process.env.RESIN_ARCH || process.arch; + +console.log('Downloading node-' + nodeVersion + '-' + os + '-' + arch); binary.download({ - os: process.platform, - arch: process.arch, + os: os, + arch: arch, version: nodeVersion }, destination, function(error, binaryPath) { if(error) { @@ -16,7 +19,7 @@ binary.download({ process.exit(1); } - var output = path.join(destination, 'node-' + process.platform + '-' + process.arch); + var output = path.join(destination, 'node-' + os + '-' + arch); if(process.platform === 'win32') { output += '.exe'; diff --git a/scripts/distribute.sh b/scripts/distribute.sh index 39936f46..23048440 100755 --- a/scripts/distribute.sh +++ b/scripts/distribute.sh @@ -27,14 +27,18 @@ function distribute() { # Copy all needed files mkdir -p build/$package + + # TODO: Omit bin/node cp -vrf bin build/$package + cp -vrf lib build/$package cp -vrf package.json build/$package print_banner "Running npm install" cd build/$package - npm install --production --force + + RESIN_OS=$os RESIN_ARCH=$arch npm install --production --force # Leaving this enabled causes # Path too long issues in Windows. @@ -56,14 +60,14 @@ function distribute() { cd .. } -distribute "darwin" "x64" +# distribute "darwin" "x64" # distribute "darwin" "x86" # distribute "linux" "x64" # distribute "linux" "x86" -# distribute "win32" "x64" -# distribute "win32" "x86" +distribute "win32" "x64" +distribute "win32" "x86" # distribute "sunos" "x64" # distribute "sunos" "x86"