diff --git a/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts b/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts index 5cf80bf929..ceb1e998b7 100644 --- a/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts +++ b/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts @@ -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';