extract git clone out of build

This commit is contained in:
igorklopov 2016-08-16 11:31:17 +03:00
parent 3a1d926654
commit 322eb8b48c

View File

@ -11,6 +11,13 @@ const buildPath = tempPath();
const nodePath = path.join(buildPath, 'node');
const patchesPath = path.resolve(__dirname, '../patches');
async function gitClone () {
const args = [ 'clone', '--progress',
'https://github.com/nodejs/node', 'node' ];
await spawn('git', args,
{ stdio: 'inherit', cwd: buildPath });
}
async function compileOnWindows (targetArch) {
const args = [];
args.push('/c', 'vcbuild.bat', targetArch, 'nosign');
@ -36,10 +43,7 @@ export default async function build (
) {
await remove(buildPath);
await mkdirp(buildPath);
await spawn('git',
[ 'clone', 'https://github.com/nodejs/node', 'node' ],
{ stdio: 'inherit', cwd: buildPath });
await gitClone();
await spawn('git',
[ 'reset', '--hard', nodeVersion ],