use fancy platform names win and osx

This commit is contained in:
igorklopov 2016-08-12 15:20:15 +03:00
parent e46762ed40
commit 742f6fe3bb
3 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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');

View File

@ -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();