Skip to content

Commit adeb189

Browse files
committed
apply review feedback
1 parent 0d74188 commit adeb189

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

dist/setup/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71842,14 +71842,7 @@ function run() {
7184271842
yield installer.getNode(version, stable, checkLatest, auth, arch);
7184371843
}
7184471844
// Output version of node is being used
71845-
let installedVersion = '';
71846-
yield exec.exec('node', ['--version'], {
71847-
listeners: {
71848-
stdout: data => {
71849-
installedVersion += data.toString();
71850-
}
71851-
}
71852-
});
71845+
const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true });
7185371846
core.setOutput('node-version', installedVersion);
7185471847
const registryUrl = core.getInput('registry-url');
7185571848
const alwaysAuth = core.getInput('always-auth');

src/main.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ export async function run() {
4141
}
4242

4343
// Output version of node is being used
44-
let installedVersion = '';
45-
await exec.exec('node', ['--version'], {
46-
listeners: {
47-
stdout: data => {
48-
installedVersion += data.toString();
49-
}
50-
}
51-
});
44+
const {stdout: installedVersion} = await exec.getExecOutput(
45+
'node',
46+
['--version'],
47+
{ignoreReturnCode: true}
48+
);
5249
core.setOutput('node-version', installedVersion);
5350

5451
const registryUrl: string = core.getInput('registry-url');

0 commit comments

Comments
 (0)