mirror of
https://github.com/actions/setup-node.git
synced 2025-04-24 12:22:12 +00:00
rebuild project
This commit is contained in:
parent
f9b4c76584
commit
f332302490
2 changed files with 968 additions and 942 deletions
42
dist/setup/index.js
vendored
42
dist/setup/index.js
vendored
|
@ -73618,14 +73618,7 @@ function run() {
|
|||
const checkLatest = (core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE';
|
||||
yield installer.getNode(version, stable, checkLatest, auth, arch);
|
||||
}
|
||||
// Output version of node is being used
|
||||
try {
|
||||
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true });
|
||||
core.setOutput('node-version', installedVersion.trim());
|
||||
}
|
||||
catch (err) {
|
||||
core.setOutput('node-version', '');
|
||||
}
|
||||
yield printEnvDetailsAndSetOutput();
|
||||
const registryUrl = core.getInput('registry-url');
|
||||
const alwaysAuth = core.getInput('always-auth');
|
||||
if (registryUrl) {
|
||||
|
@ -73665,6 +73658,39 @@ function resolveVersionInput() {
|
|||
}
|
||||
return version;
|
||||
}
|
||||
function printEnvDetailsAndSetOutput() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.startGroup('Environment details');
|
||||
const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () {
|
||||
const output = yield getToolVersion(tool, ['--version']);
|
||||
if (tool === 'node') {
|
||||
core.setOutput(`${tool}-version`, output);
|
||||
}
|
||||
core.info(`${tool}: ${output}`);
|
||||
}));
|
||||
yield Promise.all(promises);
|
||||
core.endGroup();
|
||||
});
|
||||
}
|
||||
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
||||
function getToolVersion(tool, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
});
|
||||
if (exitCode > 0) {
|
||||
core.warning(`[warning]${stderr}`);
|
||||
return '';
|
||||
}
|
||||
return stdout;
|
||||
}
|
||||
catch (err) {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Reference in a new issue