mirror of
https://github.com/actions/setup-node.git
synced 2025-07-04 08:33:47 +00:00
re-download if cached version is incorrect
This commit is contained in:
parent
5b949b50c3
commit
c5f0b687c5
3 changed files with 45 additions and 2 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -71409,6 +71409,7 @@ const core = __importStar(__nccwpck_require__(2186));
|
|||
const hc = __importStar(__nccwpck_require__(9925));
|
||||
const io = __importStar(__nccwpck_require__(7436));
|
||||
const tc = __importStar(__nccwpck_require__(7784));
|
||||
const exec = __importStar(__nccwpck_require__(1514));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const semver = __importStar(__nccwpck_require__(5911));
|
||||
const fs = __nccwpck_require__(7147);
|
||||
|
@ -71447,8 +71448,13 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
// If not found in cache, download
|
||||
if (toolPath) {
|
||||
core.info(`Found in cache @ ${toolPath}`);
|
||||
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true });
|
||||
if (!semver.satisfies(installedVersion, versionSpec)) {
|
||||
core.info(`Found ${installedVersion} in cache @ ${toolPath} but it does not satisfy the requested version (${versionSpec})`);
|
||||
toolPath = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!toolPath) {
|
||||
core.info(`Attempting to download ${versionSpec}...`);
|
||||
let downloadPath = '';
|
||||
let info = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue