diff --git a/messages/messages.md b/messages/messages.md index 375cd10b3..21f3d0729 100644 --- a/messages/messages.md +++ b/messages/messages.md @@ -107,6 +107,10 @@ Try this: This command is currently in beta. Any aspect of this command can change without advanced notice. Don't use beta commands in your scripts. +# warning.CommandInPreview + +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. + # error.InvalidArgumentFormat Error in the following argument diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 1ffa1137e..4f659fa8d 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -327,9 +327,17 @@ export abstract class SfCommand extends Command { ...(this.statics.requiresProject ? [assignProject()] : []), ]); - if (this.statics.state === 'beta') { - this.warn(messages.getMessage('warning.CommandInBeta')); + switch (this.statics.state) { + case 'beta': + this.warn(messages.getMessage('warning.CommandInBeta')); + break; + case 'preview': + this.warn(messages.getMessage('warning.CommandInPreview')); + break; + default: + break; } + // eslint-disable-next-line @typescript-eslint/require-await this.lifecycle.onWarning(async (warning: string) => { this.warningsToFlush.push(warning);