Put versions into stdout

This commit is contained in:
Uladzimir Havenchyk 2022-08-01 10:41:24 +03:00
parent 6599117e55
commit 3d6c490640
No known key found for this signature in database
GPG key ID: CAE771D3036BED13
2 changed files with 32 additions and 16 deletions

18
dist/setup/index.js vendored
View file

@ -71900,27 +71900,31 @@ function printEnvDetailsAndSetOutput() {
core.startGroup('Environment details');
// Output version of node is being used
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());
}
catch (err) {
core.setOutput('node-version', '');
}
try {
yield exec.getExecOutput('npm', ['--version'], {
ignoreReturnCode: true
const { stdout: installedNpmVersion } = yield exec.getExecOutput('npm', ['--version'], {
ignoreReturnCode: true,
silent: true
});
core.setOutput('npm-version', installedNpmVersion.trim());
}
catch (_a) {
core.warning('please check if npm is installed');
core.setOutput('npm-version', '');
}
try {
yield exec.getExecOutput('yarn', ['--version'], {
ignoreReturnCode: true
const { stdout: installedYarnVersion } = yield exec.getExecOutput('yarn', ['--version'], {
ignoreReturnCode: true,
silent: true
});
core.setOutput('yarn-version', installedYarnVersion.trim());
}
catch (_b) {
core.warning('please check if yarn is installed');
core.setOutput('yarn-version', '');
}
core.endGroup();
});

View file

@ -106,26 +106,38 @@ async function printEnvDetailsAndSetOutput() {
const {stdout: installedNodeVersion} = await exec.getExecOutput(
'node',
['--version'],
{ignoreReturnCode: true}
{ignoreReturnCode: true, silent: true}
);
core.setOutput('node-version', installedNodeVersion.trim());
} catch (err) {
core.setOutput('node-version', '');
}
try {
await exec.getExecOutput('npm', ['--version'], {
ignoreReturnCode: true
});
const {stdout: installedNpmVersion} = await exec.getExecOutput(
'npm',
['--version'],
{
ignoreReturnCode: true,
silent: true
}
);
core.setOutput('npm-version', installedNpmVersion.trim());
} catch {
core.warning('please check if npm is installed');
core.setOutput('npm-version', '');
}
try {
await exec.getExecOutput('yarn', ['--version'], {
ignoreReturnCode: true
});
const {stdout: installedYarnVersion} = await exec.getExecOutput(
'yarn',
['--version'],
{
ignoreReturnCode: true,
silent: true
}
);
core.setOutput('yarn-version', installedYarnVersion.trim());
} catch {
core.warning('please check if yarn is installed');
core.setOutput('yarn-version', '');
}
core.endGroup();