From 2cf62ef15d6cfce444baefa835095bc41579fbff Mon Sep 17 00:00:00 2001 From: Opportunity Date: Mon, 30 Sep 2019 20:35:52 +0800 Subject: [PATCH] fix --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 57002f9..be20266 100644 --- a/index.js +++ b/index.js @@ -27,11 +27,12 @@ async function fetchVersions() { async function download(sha) { const folder = await fs.mkdtemp(path.join(os.tmpdir(), 'xmake')) - await exec('git', ['init']) - await exec('git', ['remote', 'add', 'origin', 'https://github.com/xmake-io/xmake.git']) - await exec('git', ['fetch']) - await exec('git', ['checkout', sha]) - await exec('git', ['submodule', 'update', '--init', '--recursive']) + const opt = { cwd: folder } + await exec('git', ['init'], opt) + await exec('git', ['remote', 'add', 'origin', 'https://github.com/xmake-io/xmake.git'], opt) + await exec('git', ['fetch'], opt) + await exec('git', ['checkout', sha], opt) + await exec('git', ['submodule', 'update', '--init', '--recursive'], opt) return folder }