Skip to content

Commit

Permalink
feat: check for type of CLI (sfdx or sf) in addition to version number
Browse files Browse the repository at this point in the history
  • Loading branch information
daphne-sfdc committed Oct 24, 2023
1 parent 039da90 commit 03e3f6c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/salesforcedx-utils/src/cli/checkCliVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export class CheckCliVersion {
const cmdOutput = new CommandOutput();
const result = await cmdOutput.getCmdResult(execution);
console.log('**** result = ' + result);

// Get the version number of the CLI
let version = '';
for (let position = 0; position < result.length; position++) {
console.log('result[' + position + '] = {' + result[position] + '}');
Expand All @@ -41,6 +43,14 @@ export class CheckCliVersion {

}
console.log('**** version = ' + version);

// Get the type of CLI (the old SFDX or the new SF)
let isSfdx = false;
if (result.includes('sfdx')) {
isSfdx = true;
}
console.log('**** isSfdx = ' + isSfdx);

// throw new Error('Your installed CLI version is no longer supported. Uninstall CLI and reinstall it at https://developer.salesforce.com/tools/sfdxcli');

}
Expand Down

0 comments on commit 03e3f6c

Please sign in to comment.