Skip to content

Commit 21a9f92

Browse files
committed
fix: remove default license type from sbox create so config file can specify it
1 parent 9c4d867 commit 21a9f92

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

messages/clone.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ Sets the streaming client socket timeout, in minutes. If the streaming client so
4646

4747
The sandbox org cloning process %s is in progress. Run "sfdx force:org:status -n %s" to check for status. If the org is ready, checking the status also logs the requesting user in to the sandbox org and authorizes the org for use with Salesforce CLI.
4848

49-
# missingLicenseType
50-
51-
The sandbox license type is required, but you didn't provide a value. Specify the license type in the sandbox definition file with the "licenseType" option, or specify the option as a name-value pair at the command-line. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm for more information.
52-
5349
# commandOrganizationTypeNotSupport
5450

5551
The only supported org type is: %s

messages/create.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ The sandbox org creation process %s is in progress. Run "sfdx force:org:status -
104104

105105
This command requires a username. Specify it with the -u parameter or with the "sfdx config:set defaultusername=<username>" command.
106106

107-
# missingLicenseType
108-
109-
The sandbox license type is required, but you didn't provide a value. Specify the license type in the sandbox definition file with the "licenseType" option, or specify the option as a name-value pair at the command-line. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm for more information.
110-
111107
# dnsTimeout
112108

113109
The sandbox was successfully created and authenticated. However, the sandbox DNS records aren't ready yet and so the sandbox may not be available. Run "org:list" and check if the sandbox is listed correctly. If it isn't listed, run "force:org:status" to view its status and, if necessary, authenticate to it again. If this issue happens frequently, try setting the SFDX_DNS_TIMEOUT environment variable to a larger number; the default value is 3 seconds.

src/commands/org/create/sandbox.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ import { Ux } from '@salesforce/sf-plugins-core/lib/ux';
1111
import * as Interfaces from '@oclif/core/lib/interfaces';
1212
import { createSandboxRequest } from '../../../shared/sandboxRequest';
1313
import { SandboxCommandBase } from '../../../shared/sandboxCommandBase';
14+
import { SandboxLicenseType } from '../../../shared/orgTypes';
1415

1516
Messages.importMessagesDirectory(__dirname);
1617
const messages = Messages.loadMessages('@salesforce/plugin-org', 'create.sandbox');
1718

18-
export enum SandboxLicenseType {
19-
developer = 'Developer',
20-
developerPro = 'Developer_Pro',
21-
partial = 'Partial',
22-
full = 'Full',
23-
}
24-
2519
const getLicenseTypes = (): string[] => Object.values(SandboxLicenseType);
2620

2721
type SandboxConfirmData = SandboxRequest & { CloneSource?: string };
@@ -99,7 +93,6 @@ export default class CreateSandbox extends SandboxCommandBase<SandboxProcessObje
9993
char: 'l',
10094
summary: messages.getMessage('flags.licenseType.summary'),
10195
exclusive: ['definition-file', 'clone'],
102-
default: SandboxLicenseType.developer,
10396
}),
10497
'target-org': Flags.requiredOrg({
10598
char: 'o',

src/shared/orgTypes.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,10 @@ export interface ScratchCreateResponse {
9898
warnings: string[];
9999
orgId?: string;
100100
}
101+
102+
export enum SandboxLicenseType {
103+
developer = 'Developer',
104+
developerPro = 'Developer_Pro',
105+
partial = 'Partial',
106+
full = 'Full',
107+
}

src/shared/sandboxRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import * as fs from 'fs';
88
import { Logger, SandboxRequest, Messages, SfError, Lifecycle } from '@salesforce/core';
99
import { lowerToUpper } from './utils';
10+
import { SandboxLicenseType } from './orgTypes';
1011

1112
Messages.importMessagesDirectory(__dirname);
12-
const messages = Messages.loadMessages('@salesforce/plugin-org', 'create');
1313
const cloneMessages = Messages.loadMessages('@salesforce/plugin-org', 'clone');
1414

1515
export const generateSboxName = async (): Promise<string> => {
@@ -72,7 +72,7 @@ export async function createSandboxRequest(
7272
return { sandboxReq, srcSandboxName: SourceSandboxName };
7373
} else {
7474
if (!sandboxReq.LicenseType) {
75-
throw new SfError(messages.getMessage('missingLicenseType'));
75+
return { sandboxReq: { ...sandboxReq, LicenseType: SandboxLicenseType.developer } };
7676
}
7777
return { sandboxReq };
7878
}

0 commit comments

Comments
 (0)