3
0
Fork 0
mirror of https://gitea.com/actions/setup-node.git synced 2024-11-25 19:49:33 +01:00

Update installer.js (#24)

* Update installer.js

* Update installer.ts

* Update installer.js
This commit is contained in:
Danny McCormick 2019-08-05 22:23:46 -04:00 committed by GitHub
parent 213c968cb9
commit 0675b87d74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -205,18 +205,18 @@ function acquireNodeFromFallbackLocation(version) {
exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`; exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`;
libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`; libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
const exePath = yield tc.downloadTool(exeUrl); 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); 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) { catch (err) {
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
exeUrl = `https://nodejs.org/dist/v${version}/node.exe`; exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
libUrl = `https://nodejs.org/dist/v${version}/node.lib`; libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
const exePath = yield tc.downloadTool(exeUrl); 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); 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 { else {
throw err; throw err;

View file

@ -214,18 +214,18 @@ async function acquireNodeFromFallbackLocation(
libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`; libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
const exePath = await tc.downloadTool(exeUrl); 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); 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) { } catch (err) {
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
exeUrl = `https://nodejs.org/dist/v${version}/node.exe`; exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
libUrl = `https://nodejs.org/dist/v${version}/node.lib`; libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
const exePath = await tc.downloadTool(exeUrl); 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); 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 { } else {
throw err; throw err;
} }