File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/theme/src/cli/utilities Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/theme ' : patch
3+ ---
4+
5+ Add a warning for users declaring multiple environments in a command that only supports a single environment
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export default abstract class ThemeCommand extends Command {
5858 > ( _opts ?: Input < TFlags , TGlobalFlags , TArgs > ) : Promise < void > {
5959 // Parse command flags using the current command class definitions
6060 const klass = this . constructor as unknown as Input < TFlags , TGlobalFlags , TArgs > & {
61- multiEnvironmentsFlags : string [ ]
61+ multiEnvironmentsFlags : string [ ] | null
6262 flags : FlagOutput
6363 }
6464 const requiredFlags = klass . multiEnvironmentsFlags
@@ -75,6 +75,11 @@ export default abstract class ThemeCommand extends Command {
7575 }
7676
7777 // Multiple environments
78+ if ( requiredFlags === null ) {
79+ renderWarning ( { body : 'This command does not support multiple environments.' } )
80+ return
81+ }
82+
7883 const environmentsMap = await this . loadEnvironments ( environments , flags )
7984 const validationResults = await this . validateEnvironments ( environmentsMap , requiredFlags )
8085
You can’t perform that action at this time.
0 commit comments