mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 17:26:27 +00:00
Put versions into stdout
This commit is contained in:
parent
6599117e55
commit
3d6c490640
2 changed files with 32 additions and 16 deletions
18
dist/setup/index.js
vendored
18
dist/setup/index.js
vendored
|
@ -71900,27 +71900,31 @@ function printEnvDetailsAndSetOutput() {
|
||||||
core.startGroup('Environment details');
|
core.startGroup('Environment details');
|
||||||
// Output version of node is being used
|
// Output version of node is being used
|
||||||
try {
|
try {
|
||||||
const { stdout: installedNodeVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true });
|
const { stdout: installedNodeVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true });
|
||||||
core.setOutput('node-version', installedNodeVersion.trim());
|
core.setOutput('node-version', installedNodeVersion.trim());
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
core.setOutput('node-version', '');
|
core.setOutput('node-version', '');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
yield exec.getExecOutput('npm', ['--version'], {
|
const { stdout: installedNpmVersion } = yield exec.getExecOutput('npm', ['--version'], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
});
|
});
|
||||||
|
core.setOutput('npm-version', installedNpmVersion.trim());
|
||||||
}
|
}
|
||||||
catch (_a) {
|
catch (_a) {
|
||||||
core.warning('please check if npm is installed');
|
core.setOutput('npm-version', '');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
yield exec.getExecOutput('yarn', ['--version'], {
|
const { stdout: installedYarnVersion } = yield exec.getExecOutput('yarn', ['--version'], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
});
|
});
|
||||||
|
core.setOutput('yarn-version', installedYarnVersion.trim());
|
||||||
}
|
}
|
||||||
catch (_b) {
|
catch (_b) {
|
||||||
core.warning('please check if yarn is installed');
|
core.setOutput('yarn-version', '');
|
||||||
}
|
}
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
});
|
});
|
||||||
|
|
30
src/main.ts
30
src/main.ts
|
@ -106,26 +106,38 @@ async function printEnvDetailsAndSetOutput() {
|
||||||
const {stdout: installedNodeVersion} = await exec.getExecOutput(
|
const {stdout: installedNodeVersion} = await exec.getExecOutput(
|
||||||
'node',
|
'node',
|
||||||
['--version'],
|
['--version'],
|
||||||
{ignoreReturnCode: true}
|
{ignoreReturnCode: true, silent: true}
|
||||||
);
|
);
|
||||||
core.setOutput('node-version', installedNodeVersion.trim());
|
core.setOutput('node-version', installedNodeVersion.trim());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setOutput('node-version', '');
|
core.setOutput('node-version', '');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await exec.getExecOutput('npm', ['--version'], {
|
const {stdout: installedNpmVersion} = await exec.getExecOutput(
|
||||||
ignoreReturnCode: true
|
'npm',
|
||||||
});
|
['--version'],
|
||||||
|
{
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
core.setOutput('npm-version', installedNpmVersion.trim());
|
||||||
} catch {
|
} catch {
|
||||||
core.warning('please check if npm is installed');
|
core.setOutput('npm-version', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await exec.getExecOutput('yarn', ['--version'], {
|
const {stdout: installedYarnVersion} = await exec.getExecOutput(
|
||||||
ignoreReturnCode: true
|
'yarn',
|
||||||
});
|
['--version'],
|
||||||
|
{
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
core.setOutput('yarn-version', installedYarnVersion.trim());
|
||||||
} catch {
|
} catch {
|
||||||
core.warning('please check if yarn is installed');
|
core.setOutput('yarn-version', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
|
|
Loading…
Add table
Reference in a new issue