From 1b047e9fe5a70eedd88b9631e616934a7c4c6f65 Mon Sep 17 00:00:00 2001 From: Daphne Yang <139700604+daphne-sfdc@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:42:38 -0500 Subject: [PATCH] refactor: getCliVersion() with ternary operator Co-authored-by: peternhale --- packages/salesforcedx-utils/src/cli/cliVersionStatus.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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';