Skip to content

Commit 5755812

Browse files
committed
fix: messages receive the bin instead of saying "sfdx"
1 parent bfe93b7 commit 5755812

File tree

11 files changed

+46
-115
lines changed

11 files changed

+46
-115
lines changed

messages/clone.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Clone a sandbox org.
44

5-
# success
6-
7-
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.
8-
95
# description
106

117
There are two ways to clone a sandbox: either specify a sandbox definition file or provide key=value pairs at the command line. Key-value pairs at the command-line override their equivalent sandbox definition file values. In either case, you must specify both the "SandboxName" and "SourceSandboxName" options to set the names of the new sandbox and the one being cloned, respectively.
@@ -44,7 +40,7 @@ Sets the streaming client socket timeout, in minutes. If the streaming client so
4440

4541
# commandSuccess
4642

47-
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.
43+
The sandbox org cloning process %s is in progress. Run "%s 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.
4844

4945
# commandOrganizationTypeNotSupport
5046

messages/create.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ Alias for the created org.
3636

3737
Path to an org definition file.
3838

39-
# flags.definitionJson
40-
41-
Org definition in JSON format.
42-
4339
# flags.noNamespace
4440

4541
Create the scratch org with no namespace.
@@ -48,10 +44,6 @@ Create the scratch org with no namespace.
4844

4945
Do not include second-generation package ancestors in the scratch org.
5046

51-
# flags.env
52-
53-
Environment where the scratch org is created: %s.
54-
5547
# flags.type
5648

5749
Type of org to create.
@@ -98,19 +90,19 @@ One cannot use flag retry with Sandbox org create.
9890

9991
# sandboxSuccess
10092

101-
The sandbox org creation process %s is in progress. Run "sfdx force:org:status -n %s -u %s" to check for status. If the org is ready, checking the status also authorizes the org for use with Salesforce CLI.
93+
The sandbox org creation process %s is in progress. Run "%s force:org:status -n %s -u %s" to check for status. If the org is ready, checking the status also authorizes the org for use with Salesforce CLI.
10294

10395
# requiresUsername
10496

105-
This command requires a username. Specify it with the -u parameter or with the "sfdx config:set defaultusername=<username>" command.
97+
This command requires a username. Specify it with the -u parameter or with the "%s config set defaultusername=<username>" command.
10698

10799
# dnsTimeout
108100

109-
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.
101+
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 "%s org:list" and check if the sandbox is listed correctly. If it isn't listed, run "%s 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.
110102

111103
# partialSuccess
112104

113-
If you specified the -a or -s parameters, but the sandbox wasn't immediately available, the "force:org:create" command may not have finished setting the alias or defaultusername. If so, set the alias manually with "sfdx alias:set" and the defaultusername with "sfdx config:set".
105+
If you specified the -a or -s parameters, but the sandbox wasn't immediately available, the "%s force:org:create" command may not have finished setting the alias or defaultusername. If so, set the alias manually with "%s alias:set" and the defaultusername with "%s config:set".
114106

115107
# noConfig
116108

messages/create.sandbox.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ To disable source tracking in the new sandbox, specify the --no-track-source fla
102102

103103
Is the configuration correct?
104104

105-
# warning.NoSandboxNameDefined
106-
107-
No SandboxName defined, generating new SandboxName: %s.
108-
109105
# error.SandboxNameLength
110106

111107
The sandbox name "%s" should be 10 or fewer characters.

messages/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ No non-scratch orgs found.
6262

6363
# cleanWarning
6464

65-
Unable to clean org with username %s. You can run "sfdx org:delete:scratch -o %s" to remove it.`
65+
Unable to clean org with username %s. You can run "%s org:delete:scratch -o %s" to remove it.`

messages/messages.md

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,5 @@
1-
# HelpDefaults
2-
3-
If not supplied, the apiversion, template, and outputdir use default values.
4-
5-
# HelpOutputDirRelative
6-
7-
The outputdir can be an absolute path or relative to the current working directory.
8-
9-
# HelpOutputDirRelativeLightning
10-
11-
If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we create force-app/myBundle/ to store the files in the bundle.
12-
13-
# HelpExamplesTitle
14-
15-
Examples:
16-
17-
# OutputDirFlagDescription
18-
19-
folder for saving the created files
20-
21-
# OutputDirFlagLongDescription
22-
23-
The directory to store the newly created files. The location can be an absolute path or relative to the current working directory. The default is the current directory.
24-
25-
# TemplateFlagDescription
26-
27-
template to use for file creation
28-
29-
# TemplateFlagLongDescription
30-
31-
The template to use to create the file. Supplied parameter values or default values are filled into a copy of the template.
32-
33-
# TargetDirOutput
34-
35-
target dir = %s
36-
37-
# App
38-
39-
app
40-
41-
# Event
42-
43-
event
44-
45-
# Interface
46-
47-
interface
48-
49-
# Test
50-
51-
test
52-
53-
# Component
54-
55-
component
56-
57-
# Page
58-
59-
page
60-
61-
# AlphaNumericNameError
62-
63-
Name must contain only alphanumeric characters.
64-
65-
# NameMustStartWithLetterError
66-
67-
Name must start with a letter.
68-
69-
# EndWithUnderscoreError
70-
71-
Name can't end with an underscore.
72-
73-
# DoubleUnderscoreError
74-
75-
Name can't contain 2 consecutive underscores.
76-
771
# SecurityWarning
782

793
This command will expose sensitive information that allows for subsequent activity using your current authenticated session.
804
Sharing this information is equivalent to logging someone in under the current credential, resulting in unintended access and escalation of privilege.
81-
For additional information, please review the authorization section of the https://developer.salesforce.com/docs/atlas.en-us.234.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm
5+
For additional information, please review the authorization section of the https://developer.salesforce.com/docs/atlas.en-us.234.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm

messages/open.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,3 @@ Waiting to resolve the Lightning Experience-enabled custom domain...
6767
# domainTimeoutError
6868

6969
The Lightning Experience-enabled custom domain is unavailable.
70-
71-
# domainTimeoutAction
72-
73-
The Lightning Experience-enabled custom domain may take a few more minutes to resolve. Try the "org:open" command again.

src/commands/force/org/clone.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export class OrgCloneCommand extends SfCommand<SandboxProcessObject> {
8989
if (flags.type === OrgTypes.Sandbox) {
9090
lifecycle.on(SandboxEvents.EVENT_ASYNC_RESULT, async (results: SandboxProcessObject) =>
9191
// Keep all console output in the command
92-
Promise.resolve(this.log(messages.getMessage('commandSuccess', [results.Id, results.SandboxName])))
92+
Promise.resolve(
93+
this.log(messages.getMessage('commandSuccess', [results.Id, this.config.bin, results.SandboxName]))
94+
)
9395
);
9496

9597
lifecycle.on(SandboxEvents.EVENT_STATUS, async (results: StatusEvent) =>

src/commands/force/org/create.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,16 @@ export class Create extends SfCommand<CreateResult> {
166166

167167
private async createSandbox(): Promise<SandboxProcessObject> {
168168
if (!this.flags['target-org']) {
169-
throw new SfError(messages.getMessage('requiresUsername'));
169+
throw new SfError(messages.getMessage('requiresUsername', [this.config.bin]));
170170
}
171171
const lifecycle = Lifecycle.getInstance();
172172
const username = this.flags['target-org'].getUsername();
173173
// register the sandbox event listeners before calling `prodOrg.createSandbox()`
174174

175175
lifecycle.on(SandboxEvents.EVENT_ASYNC_RESULT, async (results: SandboxProcessObject) =>
176-
Promise.resolve(this.log(messages.getMessage('sandboxSuccess', [results.Id, results.SandboxName, username])))
176+
Promise.resolve(
177+
this.log(messages.getMessage('sandboxSuccess', [results.Id, this.config.bin, results.SandboxName, username]))
178+
)
177179
);
178180

179181
lifecycle.on(SandboxEvents.EVENT_STATUS, async (results: StatusEvent) =>
@@ -233,7 +235,10 @@ export class Create extends SfCommand<CreateResult> {
233235
const result = await globalConfig.write();
234236
this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
235237
}
236-
err.actions = [messages.getMessage('dnsTimeout'), messages.getMessage('partialSuccess')];
238+
err.actions = [
239+
messages.getMessage('dnsTimeout', [this.config.bin, this.config.bin]),
240+
messages.getMessage('partialSuccess', [this.config.bin, this.config.bin, this.config.bin]),
241+
];
237242
err.exitCode = 68;
238243
}
239244

src/commands/org/list.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ export class OrgListCommand extends SfCommand<OrgListResult> {
102102
const org = await Org.create({ aliasOrUsername: fields.username, connection });
103103
await org.remove();
104104
} catch (e) {
105-
const err = e as SfError;
106-
const logger = await Logger.child('org:list');
107-
logger.debug(`Error cleaning org ${fields.username}: ${err.message}`);
108-
this.warn(messages.getMessage('cleanWarning', [fields.username, fields.username]));
105+
this.warn(messages.getMessage('cleanWarning', [fields.username, this.config.bin, fields.username]));
106+
if (e instanceof Error) {
107+
const logger = await Logger.child('org:list');
108+
logger.debug(`Error cleaning org ${fields.username}: ${e.message}`);
109+
}
109110
}
110111
})
111112
);

test/nut/legacy/sandbox.sandboxNut.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,17 @@ describe('Sandbox Orgs via legacy org:create', () => {
4242
console.log(e);
4343
assert(e instanceof SfError);
4444
// there was a DNS issue, verify we handled it as best as we could
45-
expect(e.message, 'org:create DNS issue').to.include(messages.getMessage('partialSuccess'));
46-
expect(e.message, 'org:create DNS issue').to.include(messages.getMessage('dnsTimeout'));
4745
expect(e.exitCode, 'org:create DNS issue').to.equal(68);
46+
// it'll be one of the CLIs
47+
try {
48+
expect(e.message, 'org:create DNS issue').to.include(messages.getMessage('partialSuccess', ['sf', 'sf', 'sf']));
49+
expect(e.message, 'org:create DNS issue').to.include(messages.getMessage('dnsTimeout', ['sf', 'sf']));
50+
} catch {
51+
expect(e.message, 'org:create DNS issue').to.include(
52+
messages.getMessage('partialSuccess', ['sfdx', 'sfdx', 'sfdx'])
53+
);
54+
expect(e.message, 'org:create DNS issue').to.include(messages.getMessage('dnsTimeout', ['sfdx', 'sfdx']));
55+
}
4856
}
4957
assert(result, JSON.stringify(result));
5058
// autogenerated sandbox names start with 'sbx'

0 commit comments

Comments
 (0)