diff --git a/lib/build-and-upload.js b/lib/build-and-upload.js index 8dfcba2..b171666 100644 --- a/lib/build-and-upload.js +++ b/lib/build-and-upload.js @@ -2,12 +2,11 @@ import { localPlace, remotePlace } from './places.js'; import build from './build.js'; import chalk from 'chalk'; import patchesJson from '../patches/patches.json'; +import platform from './system.js'; import { targets } from './system.js'; import upload from './upload.js'; import { version } from '../package.json'; -const { platform } = process; - function isBrokenBuild (nodeVersion, target) { if (/^v?0/.test(nodeVersion) && /^arm/.test(target)) return true; diff --git a/lib/build.js b/lib/build.js index 5afaa29..f3d687a 100644 --- a/lib/build.js +++ b/lib/build.js @@ -5,8 +5,7 @@ import path from 'path'; import rimraf from 'rimraf-promise'; import { spawn } from './spawn.js'; -const platform = process.platform; -const windows = platform === 'win32'; +const windows = process.platform === 'win32'; const buildPath = path.resolve(__dirname, '../temp'); const nodePath = path.join(buildPath, 'node'); const patchesPath = path.resolve(__dirname, '../patches'); diff --git a/lib/system.js b/lib/system.js index 83b4174..76ac125 100644 --- a/lib/system.js +++ b/lib/system.js @@ -4,6 +4,13 @@ function getAbi () { return 'm' + process.versions.modules; } +function getPlatform () { + var platform = process.platform; + if (platform === 'darwin') return 'osx'; + if (platform === 'win32') return 'win'; + return platform; +} + function getArmHost () { var cpu = fs.readFileSync('/proc/cpuinfo', 'utf8'); if (cpu.indexOf('vfpv3') >= 0) return 'armv7'; @@ -36,6 +43,7 @@ function getKnownTargets () { } export const abi = getAbi(); +export const platform = getPlatform(); export const host = getHost(); export const targets = getTargets(); export const knownTargets = getKnownTargets();