Skip to content

Commit

Permalink
refactor: getCliVersion() with ternary operator
Browse files Browse the repository at this point in the history
Co-authored-by: peternhale <[email protected]>
  • Loading branch information
daphne-sfdc and peternhale authored Dec 28, 2023
1 parent f1c5f66 commit 1b047e9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/salesforcedx-utils/src/cli/cliVersionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ export class CliVersionStatus {

public getCliVersion(isSfdx: boolean): string {
try {
let result;
if (isSfdx) {
result = execSync('sfdx --version');
} else {
result = execSync('sf --version');
}
const result = execSync(`${isSfdx ? 'sfdx' : 'sf'} --version`);
return result.toString();
} catch {
return 'No CLI';
Expand Down

0 comments on commit 1b047e9

Please sign in to comment.