Skip to content

Commit 77ac877

Browse files
committed
refactor: use best practices
1 parent f38bcf8 commit 77ac877

File tree

16 files changed

+313
-728
lines changed

16 files changed

+313
-728
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"main": "lib/index.js",
77
"bugs": "https://github.com/forcedotcom/cli/issues",
88
"dependencies": {
9-
"@oclif/core": "^2.1.0",
9+
"@oclif/core": "^2.2.1",
1010
"@salesforce/core": "^3.33.1",
1111
"@salesforce/kit": "^1.8.5",
12-
"@salesforce/sf-plugins-core": "^2.1.1",
12+
"@salesforce/sf-plugins-core": "^2.2.0",
1313
"open": "8.4.1",
1414
"tslib": "^2"
1515
},
@@ -222,4 +222,4 @@
222222
"output": []
223223
}
224224
}
225-
}
225+
}

src/commands/force/org/clone.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from '@salesforce/sf-plugins-core';
1616
import {
1717
SfError,
18-
Config,
1918
Lifecycle,
2019
Messages,
2120
OrgTypes,
@@ -112,7 +111,7 @@ export class OrgCloneCommand extends SfCommand<SandboxProcessObject> {
112111
logger.debug('Set Alias: %s result: %s', flags.setalias, result);
113112
}
114113
if (flags.setdefaultusername) {
115-
const globalConfig: Config = this.configAggregator.getGlobalConfig();
114+
const globalConfig = this.configAggregator.getGlobalConfig();
116115
globalConfig.set(OrgConfigProperties.TARGET_ORG, results.sandboxRes.authUserName);
117116
const result = await globalConfig.write();
118117
logger.debug('Set defaultUsername: %s result: %s', flags.setdefaultusername, result);

src/commands/force/org/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class Create extends SfCommand<CreateResult> {
214214
try {
215215
return await this.flags['target-org'].createSandbox(sandboxReq, { wait });
216216
} catch (e) {
217-
// guaranteed to be SfdxError from core;
217+
// guaranteed to be SfError from core;
218218
const err = e as SfError;
219219
if (err?.message.includes('The org cannot be found')) {
220220
// there was most likely an issue with DNS when auth'ing to the new sandbox, but it was created.

src/commands/org/display.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,12 @@ export class OrgDisplayCommand extends SfCommand<OrgDisplayReturn> {
7979
alias: await getAliasByUsername(fields.username),
8080
};
8181
this.warn(sharedMessages.getMessage('SecurityWarning'));
82-
83-
if (!flags.json) {
84-
this.print(returnValue);
85-
}
82+
this.print(returnValue);
8683
return returnValue;
8784
}
8885

8986
private print(result: OrgDisplayReturn): void {
90-
this.log('');
87+
this.log();
9188
const tableRows = Object.entries(result)
9289
.filter(([, value]) => value !== undefined && value !== null) // some values won't exist
9390
.sort() // this command always alphabetizes the table rows

test/unit/createSandbox.test.ts

Lines changed: 0 additions & 125 deletions
This file was deleted.

test/unit/display.test.ts

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)