Skip to content

Commit 5dcce40

Browse files
feat: add --wait flag to resume scratch org (#1376)
* feat: add --wait flag to resume scratch org * fix: update the wait flags * fix: update the flags wait for resume scratch * chore: bump sfdx-core --------- Co-authored-by: Cristian Dominguez <[email protected]>
1 parent 29cbe7e commit 5dcce40

File tree

5 files changed

+57
-361
lines changed

5 files changed

+57
-361
lines changed

command-snapshot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176
"alias": ["env:resume:scratch"],
177177
"command": "org:resume:scratch",
178178
"flagAliases": [],
179-
"flagChars": ["i", "r"],
180-
"flags": ["flags-dir", "job-id", "json", "use-most-recent"],
179+
"flagChars": ["i", "r", "w"],
180+
"flags": ["flags-dir", "job-id", "json", "use-most-recent", "wait"],
181181
"plugin": "@salesforce/plugin-org"
182182
}
183183
]

messages/resume_scratch.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ The job ID is the same as the record ID of the incomplete scratch org in the Scr
2828

2929
The job ID is valid for 24 hours after you start the scratch org creation.
3030

31+
# flags.wait.summary
32+
33+
Number of minutes to wait for the scratch org to be ready.
34+
35+
# flags.wait.description
36+
37+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and returns the job ID. To resume checking the scratch creation, rerun this command.
38+
3139
# flags.use-most-recent.summary
3240

3341
Use the job ID of the most recent incomplete scratch org.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"@oclif/core": "^4.2.10",
99
"@oclif/multi-stage-output": "^0.8.12",
10-
"@salesforce/core": "^8.8.7",
10+
"@salesforce/core": "^8.9.0",
1111
"@salesforce/kit": "^3.2.3",
1212
"@salesforce/sf-plugins-core": "^12.2.1",
1313
"@salesforce/source-deploy-retrieve": "^12.18.2",

src/commands/org/resume/scratch.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
4646
summary: messages.getMessage('flags.use-most-recent.summary'),
4747
exactlyOne: ['use-most-recent', 'job-id'],
4848
}),
49+
wait: Flags.duration({
50+
char: 'w',
51+
summary: messages.getMessage('flags.wait.summary'),
52+
description: messages.getMessage('flags.wait.description'),
53+
min: 0,
54+
unit: 'minutes',
55+
helpValue: '<minutes>',
56+
defaultValue: 0,
57+
}),
4958
};
5059

5160
public async run(): Promise<ScratchCreateResponse> {
@@ -105,7 +114,8 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
105114
});
106115

107116
try {
108-
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgResume(jobId);
117+
const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgResume(jobId, flags.wait);
118+
109119
this.log();
110120
this.logSuccess(messages.getMessage('success'));
111121
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };

0 commit comments

Comments
 (0)