diff --git a/dist/setup/index.js b/dist/setup/index.js index 68064615..f0517538 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71842,14 +71842,7 @@ function run() { yield installer.getNode(version, stable, checkLatest, auth, arch); } // Output version of node is being used - let installedVersion = ''; - yield exec.exec('node', ['--version'], { - listeners: { - stdout: data => { - installedVersion += data.toString(); - } - } - }); + const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true }); core.setOutput('node-version', installedVersion); const registryUrl = core.getInput('registry-url'); const alwaysAuth = core.getInput('always-auth'); diff --git a/src/main.ts b/src/main.ts index 106de77d..5cfba617 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,14 +41,11 @@ export async function run() { } // Output version of node is being used - let installedVersion = ''; - await exec.exec('node', ['--version'], { - listeners: { - stdout: data => { - installedVersion += data.toString(); - } - } - }); + const {stdout: installedVersion} = await exec.getExecOutput( + 'node', + ['--version'], + {ignoreReturnCode: true} + ); core.setOutput('node-version', installedVersion); const registryUrl: string = core.getInput('registry-url');