reexpose system, implement getKnownPlatforms

This commit is contained in:
igorklopov 2016-08-22 13:42:12 +03:00
parent 3b6e89d715
commit 75f2a237a9
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import { log } from './log.js';
import patchesJson from '../patches/patches.json';
import path from 'path';
import semver from 'semver';
import * as system from './system.js'; // eslint-disable-line no-duplicate-imports
import { version } from '../package.json';
export async function need ({
@ -44,3 +45,5 @@ export async function need ({
await build(nodeVersion, arch, local);
return local;
}
export { system };

View File

@ -23,6 +23,10 @@ function getHostPlatform () {
return toFancyPlatform(platform);
}
function getKnownPlatforms () {
return [ 'linux', 'osx', 'win' ];
}
export function toFancyArch (arch) {
if (arch === 'ia32') return 'x86';
if (arch === 'x86_64') return 'x64';
@ -58,6 +62,7 @@ function getKnownArchs () {
export const hostAbi = getHostAbi();
export const hostPlatform = getHostPlatform();
export const knownPlatforms = getKnownPlatforms();
export const hostArch = getHostArch();
export const targetArchs = getTargetArchs();
export const knownArchs = getKnownArchs();