mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Pass os/arch to install-node.js with env vars
This commit is contained in:
parent
9807bf308c
commit
7c53b35cbd
@ -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';
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user