mirror of
https://github.com/actions/setup-node.git
synced 2024-12-28 08:48:17 +08:00
testing 7z alt
This commit is contained in:
parent
11f920585c
commit
beb2155295
9
dist/index.js
vendored
9
dist/index.js
vendored
@ -12975,6 +12975,7 @@ const io = __importStar(__webpack_require__(1));
|
|||||||
const tc = __importStar(__webpack_require__(533));
|
const tc = __importStar(__webpack_require__(533));
|
||||||
const path = __importStar(__webpack_require__(622));
|
const path = __importStar(__webpack_require__(622));
|
||||||
const semver = __importStar(__webpack_require__(280));
|
const semver = __importStar(__webpack_require__(280));
|
||||||
|
const fs = __webpack_require__(747);
|
||||||
function getNode(versionSpec, stable, token) {
|
function getNode(versionSpec, stable, token) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let osPlat = os.platform();
|
let osPlat = os.platform();
|
||||||
@ -13017,7 +13018,10 @@ function getNode(versionSpec, stable, token) {
|
|||||||
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
|
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
|
||||||
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
|
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
|
||||||
// 7z extracts to folder matching file name
|
// 7z extracts to folder matching file name
|
||||||
extPath = path.join(extPath, path.basename(info.fileName, '.7z'));
|
let nestedPath = path.join(extPath, path.basename(info.fileName, '.7z'));
|
||||||
|
if (fs.statSync(nestedPath) && fs.statSync(nestedPath).isDirectory()) {
|
||||||
|
extPath = nestedPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
extPath = yield tc.extractTar(downloadPath, undefined, [
|
extPath = yield tc.extractTar(downloadPath, undefined, [
|
||||||
@ -13048,7 +13052,8 @@ exports.getNode = getNode;
|
|||||||
function getInfoFromManifest(versionSpec, stable, token) {
|
function getInfoFromManifest(versionSpec, stable, token) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let info = null;
|
let info = null;
|
||||||
const releases = yield tc.getManifestFromRepo('actions', 'node-versions', token);
|
const releases = yield tc.getManifestFromRepo('actions', 'node-versions', token, 'update-versions-manifest-file' // TODO: remove after testing
|
||||||
|
);
|
||||||
console.log(`matching ${versionSpec}...`);
|
console.log(`matching ${versionSpec}...`);
|
||||||
const rel = yield tc.findFromManifest(versionSpec, stable, releases);
|
const rel = yield tc.findFromManifest(versionSpec, stable, releases);
|
||||||
if (rel && rel.files.length > 0) {
|
if (rel && rel.files.length > 0) {
|
||||||
|
@ -79,7 +79,10 @@ export async function getNode(
|
|||||||
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
|
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
|
||||||
extPath = await tc.extract7z(downloadPath, undefined, _7zPath);
|
extPath = await tc.extract7z(downloadPath, undefined, _7zPath);
|
||||||
// 7z extracts to folder matching file name
|
// 7z extracts to folder matching file name
|
||||||
extPath = path.join(extPath, path.basename(info.fileName, '.7z'));
|
let nestedPath = path.join(extPath, path.basename(info.fileName, '.7z'));
|
||||||
|
if (fs.statSync(nestedPath) && fs.statSync(nestedPath).isDirectory()) {
|
||||||
|
extPath = nestedPath;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
extPath = await tc.extractTar(downloadPath, undefined, [
|
extPath = await tc.extractTar(downloadPath, undefined, [
|
||||||
'xz',
|
'xz',
|
||||||
@ -117,7 +120,8 @@ async function getInfoFromManifest(
|
|||||||
const releases = await tc.getManifestFromRepo(
|
const releases = await tc.getManifestFromRepo(
|
||||||
'actions',
|
'actions',
|
||||||
'node-versions',
|
'node-versions',
|
||||||
token
|
token,
|
||||||
|
'update-versions-manifest-file' // TODO: remove after testing
|
||||||
);
|
);
|
||||||
console.log(`matching ${versionSpec}...`);
|
console.log(`matching ${versionSpec}...`);
|
||||||
const rel = await tc.findFromManifest(versionSpec, stable, releases);
|
const rel = await tc.findFromManifest(versionSpec, stable, releases);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user