File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
packages/theme/src/cli/utilities Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/theme ' : patch
3+ ---
4+
5+ Clean up theme command to run either single/no environment or multiple environments
Original file line number Diff line number Diff line change @@ -56,22 +56,10 @@ export default abstract class ThemeCommand extends Command {
5656 const requiredFlags = klass . multiEnvironmentsFlags
5757 const { flags} = await this . parse ( klass )
5858
59- // No environment provided
60- if ( ! flags . environment ?. length ) {
61- const session = await this . ensureAuthenticated ( flags )
62-
63- await this . command ( flags , session )
64-
65- return
66- }
67-
68- // OCLIF parses flags.environment as an array when using the --environment & -e flag but
69- // as a string when using the direct environment variable SHOPIFY_FLAG_ENVIRONMENT
70- // This handles both cases
71- const environments = Array . isArray ( flags . environment ) ? flags . environment : [ flags . environment ]
59+ const environments = ( Array . isArray ( flags . environment ) ? flags . environment : [ flags . environment ] ) . filter ( Boolean )
7260
73- // If only one environment is specified, treat it as single environment mode
74- if ( environments . length == = 1 ) {
61+ // Single environment or no environment
62+ if ( environments . length < = 1 ) {
7563 const session = await this . ensureAuthenticated ( flags )
7664 await this . command ( flags , session )
7765 return
You can’t perform that action at this time.
0 commit comments