Skip to content

Commit

Permalink
apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 30, 2022
1 parent 0d74188 commit adeb189
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
9 changes: 1 addition & 8 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
13 changes: 5 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit adeb189

Please sign in to comment.