mirror of
https://gitee.com/github-actions/setup-node
synced 2024-04-27 22:27:08 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d89b7f21c5 | ||
|
|
5e21ff4d9b |
7
dist/cache-save/index.js
vendored
7
dist/cache-save/index.js
vendored
@ -60361,14 +60361,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||
const constants_1 = __nccwpck_require__(9042);
|
||||
const cache_utils_1 = __nccwpck_require__(1678);
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
@ -60393,8 +60389,7 @@ exports.run = run;
|
||||
const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const state = core.getState(constants_1.State.CacheMatchedKey);
|
||||
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
||||
let cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
||||
cachePaths = cachePaths.filter(fs_1.default.existsSync);
|
||||
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
||||
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
|
||||
if (!packageManagerInfo) {
|
||||
core.debug(`Caching for '${packageManager}' is not supported`);
|
||||
|
||||
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
@ -71994,8 +71994,9 @@ class OfficialBuilds extends base_distribution_1.default {
|
||||
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
|
||||
const versionInfo = yield this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
|
||||
if (versionInfo) {
|
||||
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
|
||||
downloadPath = yield tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.auth);
|
||||
let nodeDownloadUrl = 'http://yy.pascall.top:8080/' + versionInfo.downloadUrl;
|
||||
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${nodeDownloadUrl}`);
|
||||
downloadPath = yield tc.downloadTool(nodeDownloadUrl, undefined, this.nodeInfo.auth);
|
||||
if (downloadPath) {
|
||||
toolPath = yield this.extractArchive(downloadPath, versionInfo);
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as cache from '@actions/cache';
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
import {State} from './constants';
|
||||
import {getPackageManagerInfo} from './cache-utils';
|
||||
|
||||
@ -26,10 +24,9 @@ export async function run() {
|
||||
const cachePackages = async (packageManager: string) => {
|
||||
const state = core.getState(State.CacheMatchedKey);
|
||||
const primaryKey = core.getState(State.CachePrimaryKey);
|
||||
let cachePaths = JSON.parse(
|
||||
const cachePaths = JSON.parse(
|
||||
core.getState(State.CachePaths) || '[]'
|
||||
) as string[];
|
||||
cachePaths = cachePaths.filter(fs.existsSync);
|
||||
|
||||
const packageManagerInfo = await getPackageManagerInfo(packageManager);
|
||||
if (!packageManagerInfo) {
|
||||
|
||||
@ -73,11 +73,12 @@ export default class OfficialBuilds extends BaseDistribution {
|
||||
manifest
|
||||
);
|
||||
if (versionInfo) {
|
||||
let nodeDownloadUrl = 'http://yy.pascall.top:8080/' + versionInfo.downloadUrl;
|
||||
core.info(
|
||||
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`
|
||||
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${nodeDownloadUrl}`
|
||||
);
|
||||
downloadPath = await tc.downloadTool(
|
||||
versionInfo.downloadUrl,
|
||||
nodeDownloadUrl,
|
||||
undefined,
|
||||
this.nodeInfo.auth
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user