list of possible targets out of current host (x64,x86 out of x64)

This commit is contained in:
igorklopov 2016-08-09 18:31:04 +03:00
parent 8d5c61d3fc
commit 253b06bc04
2 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,4 @@
import { arch, platform } from './system.js';
import { arch, platform, targets } from './system.js';
import chipo from 'child-process-promise';
import chalk from 'chalk';
import { localPath } from './places.js';
@ -13,18 +13,20 @@ const patchesPath = path.resolve(__dirname, '../patches');
async function main () {
for (const nodeVersion in patchesJson) {
await rimraf(buildPath);
await mkdirp(buildPath);
for (const target of targets) {
await rimraf(buildPath);
await mkdirp(buildPath);
await chipo.spawn('git',
[ 'clone', 'https://github.com/nodejs/node', 'node' ],
{ stdio: 'inherit', cwd: buildPath });
await chipo.spawn('git',
[ 'clone', 'https://github.com/nodejs/node', 'node' ],
{ stdio: 'inherit', cwd: buildPath });
await chipo.spawn('git',
[ 'reset', '--hard', nodeVersion ],
{ stdio: 'inherit', cwd: buildPath + '/node' });
await chipo.spawn('git',
[ 'reset', '--hard', nodeVersion ],
{ stdio: 'inherit', cwd: buildPath + '/node' });
// const patches = patchesJson[nodeVersion];
// const patches = patchesJson[nodeVersion];
}
}
}

View File

@ -21,6 +21,12 @@ function getArch () {
return arch;
}
function getTargets () {
// TODO x64, x86 from 'x64'?
return getArch();
}
export const abi = getAbi();
export const arch = getArch();
export const platform = process.platform;
export const targets = getTargets();