Skip to content

Commit 552489c

Browse files
author
Danny McCormick
committed
Fix backup downloads
1 parent 401832e commit 552489c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/installer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,18 @@ function acquireNodeFromFallbackLocation(version) {
205205
exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`;
206206
libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
207207
const exePath = yield tc.downloadTool(exeUrl);
208-
yield io.mv(exePath, path.join(tempDir, 'node.exe'));
208+
yield io.cp(exePath, path.join(tempDir, 'node.exe'));
209209
const libPath = yield tc.downloadTool(libUrl);
210-
yield io.mv(libPath, path.join(tempDir, 'node.lib'));
210+
yield io.cp(libPath, path.join(tempDir, 'node.lib'));
211211
}
212212
catch (err) {
213213
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
214214
exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
215215
libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
216216
const exePath = yield tc.downloadTool(exeUrl);
217-
yield io.mv(exePath, path.join(tempDir, 'node.exe'));
217+
yield io.cp(exePath, path.join(tempDir, 'node.exe'));
218218
const libPath = yield tc.downloadTool(libUrl);
219-
yield io.mv(libPath, path.join(tempDir, 'node.lib'));
219+
yield io.cp(libPath, path.join(tempDir, 'node.lib'));
220220
}
221221
else {
222222
throw err;

src/installer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,18 @@ async function acquireNodeFromFallbackLocation(
214214
libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
215215

216216
const exePath = await tc.downloadTool(exeUrl);
217-
await io.mv(exePath, path.join(tempDir, 'node.exe'));
217+
await io.cp(exePath, path.join(tempDir, 'node.exe'));
218218
const libPath = await tc.downloadTool(libUrl);
219-
await io.mv(libPath, path.join(tempDir, 'node.lib'));
219+
await io.cp(libPath, path.join(tempDir, 'node.lib'));
220220
} catch (err) {
221221
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
222222
exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
223223
libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
224224

225225
const exePath = await tc.downloadTool(exeUrl);
226-
await io.mv(exePath, path.join(tempDir, 'node.exe'));
226+
await io.cp(exePath, path.join(tempDir, 'node.exe'));
227227
const libPath = await tc.downloadTool(libUrl);
228-
await io.mv(libPath, path.join(tempDir, 'node.lib'));
228+
await io.cp(libPath, path.join(tempDir, 'node.lib'));
229229
} else {
230230
throw err;
231231
}

0 commit comments

Comments
 (0)