Skip to content

Commit 2205b5a

Browse files
authored
Merge pull request #668 from salesforcecli/ew/add-preview-state
W-17908565 Add a preview state for commands
2 parents 2bc4359 + c470d85 commit 2205b5a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

messages/messages.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Try this:
107107

108108
This command is currently in beta. Any aspect of this command can change without advanced notice. Don't use beta commands in your scripts.
109109

110+
# warning.CommandInPreview
111+
112+
This command is currently in developer preview. Developer preview commands will likely change before shipping, use at your own risk. Don't use developer preview commands in your scripts.
113+
110114
# error.InvalidArgumentFormat
111115

112116
Error in the following argument

src/sfCommand.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,17 @@ export abstract class SfCommand<T> extends Command {
327327
...(this.statics.requiresProject ? [assignProject()] : []),
328328
]);
329329

330-
if (this.statics.state === 'beta') {
331-
this.warn(messages.getMessage('warning.CommandInBeta'));
330+
switch (this.statics.state) {
331+
case 'beta':
332+
this.warn(messages.getMessage('warning.CommandInBeta'));
333+
break;
334+
case 'preview':
335+
this.warn(messages.getMessage('warning.CommandInPreview'));
336+
break;
337+
default:
338+
break;
332339
}
340+
333341
// eslint-disable-next-line @typescript-eslint/require-await
334342
this.lifecycle.onWarning(async (warning: string) => {
335343
this.warningsToFlush.push(warning);

0 commit comments

Comments
 (0)