mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-08 21:21:12 +00:00
strip 1 on fallback extract
This commit is contained in:
parent
ed3a918d25
commit
2bdb2ab1c9
5 changed files with 52 additions and 18 deletions
48
dist/index.js
vendored
48
dist/index.js
vendored
|
@ -563,13 +563,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const os = __webpack_require__(87);
|
||||
const events = __webpack_require__(614);
|
||||
const child = __webpack_require__(129);
|
||||
const path = __webpack_require__(622);
|
||||
const io = __webpack_require__(1);
|
||||
const ioUtil = __webpack_require__(672);
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const events = __importStar(__webpack_require__(614));
|
||||
const child = __importStar(__webpack_require__(129));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const io = __importStar(__webpack_require__(1));
|
||||
const ioUtil = __importStar(__webpack_require__(672));
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
/*
|
||||
|
@ -1013,6 +1020,12 @@ class ToolRunner extends events.EventEmitter {
|
|||
resolve(exitCode);
|
||||
}
|
||||
});
|
||||
if (this.options.input) {
|
||||
if (!cp.stdin) {
|
||||
throw new Error('child process missing stdin');
|
||||
}
|
||||
cp.stdin.end(this.options.input);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -11076,7 +11089,13 @@ function extractTar(file, dest, flags = 'xz') {
|
|||
core.debug(versionOutput.trim());
|
||||
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
|
||||
// Initialize args
|
||||
const args = [flags];
|
||||
let args;
|
||||
if (flags instanceof Array) {
|
||||
args = flags;
|
||||
}
|
||||
else {
|
||||
args = [flags];
|
||||
}
|
||||
let destArg = dest;
|
||||
let fileArg = file;
|
||||
if (IS_WINDOWS && isGnuTar) {
|
||||
|
@ -12998,7 +13017,11 @@ function getNode(versionSpec, stable, token) {
|
|||
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
|
||||
}
|
||||
else {
|
||||
extPath = yield tc.extractTar(downloadPath);
|
||||
extPath = yield tc.extractTar(downloadPath, undefined, [
|
||||
'xz',
|
||||
'--strip',
|
||||
'1'
|
||||
]);
|
||||
}
|
||||
//
|
||||
// Install into the local tool cache - node extracts with a root folder that matches the fileName downloaded
|
||||
|
@ -16735,8 +16758,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tr = __webpack_require__(9);
|
||||
const tr = __importStar(__webpack_require__(9));
|
||||
/**
|
||||
* Exec a command.
|
||||
* Output will be streamed to the live console.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue