mirror of
https://codeberg.org/actions/setup-node.git
synced 2023-07-31 13:16:24 +00:00
Merge pull request #540 from dmitry-shibanov/fix-error-node-version
Fix error node version output
This commit is contained in:
commit
ad8542ca5e
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
|
@ -71846,8 +71846,13 @@ function run() {
|
|||
yield installer.getNode(version, stable, checkLatest, auth, arch);
|
||||
}
|
||||
// Output version of node is being used
|
||||
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true });
|
||||
core.setOutput('node-version', installedVersion);
|
||||
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', '');
|
||||
}
|
||||
const registryUrl = core.getInput('registry-url');
|
||||
const alwaysAuth = core.getInput('always-auth');
|
||||
if (registryUrl) {
|
||||
|
|
16
src/main.ts
16
src/main.ts
|
@ -41,12 +41,16 @@ export async function run() {
|
|||
}
|
||||
|
||||
// Output version of node is being used
|
||||
const {stdout: installedVersion} = await exec.getExecOutput(
|
||||
'node',
|
||||
['--version'],
|
||||
{ignoreReturnCode: true}
|
||||
);
|
||||
core.setOutput('node-version', installedVersion);
|
||||
try {
|
||||
const {stdout: installedVersion} = await exec.getExecOutput(
|
||||
'node',
|
||||
['--version'],
|
||||
{ignoreReturnCode: true, silent: true}
|
||||
);
|
||||
core.setOutput('node-version', installedVersion.trim());
|
||||
} catch (err) {
|
||||
core.setOutput('node-version', '');
|
||||
}
|
||||
|
||||
const registryUrl: string = core.getInput('registry-url');
|
||||
const alwaysAuth: string = core.getInput('always-auth');
|
||||
|
|
Loading…
Reference in a new issue