From 0675b87d744c2c71a8eb341a3795366755a5bdb8 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 5 Aug 2019 22:23:46 -0400 Subject: [PATCH] Update installer.js (#24) * Update installer.js * Update installer.ts * Update installer.js --- lib/installer.js | 8 ++++---- src/installer.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/installer.js b/lib/installer.js index 7e6a7dec..29de9a01 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -205,18 +205,18 @@ function acquireNodeFromFallbackLocation(version) { exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`; libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`; const exePath = yield tc.downloadTool(exeUrl); - yield io.mv(exePath, path.join(tempDir, 'node.exe')); + yield io.cp(exePath, path.join(tempDir, 'node.exe')); const libPath = yield tc.downloadTool(libUrl); - yield io.mv(libPath, path.join(tempDir, 'node.lib')); + yield io.cp(libPath, path.join(tempDir, 'node.lib')); } catch (err) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { exeUrl = `https://nodejs.org/dist/v${version}/node.exe`; libUrl = `https://nodejs.org/dist/v${version}/node.lib`; const exePath = yield tc.downloadTool(exeUrl); - yield io.mv(exePath, path.join(tempDir, 'node.exe')); + yield io.cp(exePath, path.join(tempDir, 'node.exe')); const libPath = yield tc.downloadTool(libUrl); - yield io.mv(libPath, path.join(tempDir, 'node.lib')); + yield io.cp(libPath, path.join(tempDir, 'node.lib')); } else { throw err; diff --git a/src/installer.ts b/src/installer.ts index 1697cd4c..7433ff3c 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -214,18 +214,18 @@ async function acquireNodeFromFallbackLocation( libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`; const exePath = await tc.downloadTool(exeUrl); - await io.mv(exePath, path.join(tempDir, 'node.exe')); + await io.cp(exePath, path.join(tempDir, 'node.exe')); const libPath = await tc.downloadTool(libUrl); - await io.mv(libPath, path.join(tempDir, 'node.lib')); + await io.cp(libPath, path.join(tempDir, 'node.lib')); } catch (err) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { exeUrl = `https://nodejs.org/dist/v${version}/node.exe`; libUrl = `https://nodejs.org/dist/v${version}/node.lib`; const exePath = await tc.downloadTool(exeUrl); - await io.mv(exePath, path.join(tempDir, 'node.exe')); + await io.cp(exePath, path.join(tempDir, 'node.exe')); const libPath = await tc.downloadTool(libUrl); - await io.mv(libPath, path.join(tempDir, 'node.lib')); + await io.cp(libPath, path.join(tempDir, 'node.lib')); } else { throw err; }