@@ -72,7 +72,19 @@ export default abstract class ThemeCommand extends Command {
7272
7373 // If only one environment is specified, treat it as single environment mode
7474 if ( environments . length === 1 ) {
75- const environmentConfig = await loadEnvironment ( environments [ 0 ] , 'shopify.theme.toml' , { from : flags . path } )
75+ const environmentName = environments [ 0 ]
76+ // If the environment is the default environment, the config is already available.
77+ if ( environmentName === 'default' ) {
78+ const session = await this . ensureAuthenticated ( flags )
79+ await this . command ( flags , session )
80+ return
81+ }
82+
83+ // For non-default environments, we need to load the config
84+ const environmentConfig = await loadEnvironment ( environmentName , 'shopify.theme.toml' , {
85+ from : flags . path ,
86+ silent : true ,
87+ } )
7688 const environmentFlags = {
7789 ...flags ,
7890 ...environmentConfig ,
@@ -92,7 +104,10 @@ export default abstract class ThemeCommand extends Command {
92104 // with authentication happening in parallel.
93105 for ( const environmentName of environments ) {
94106 // eslint-disable-next-line no-await-in-loop
95- const environmentConfig = await loadEnvironment ( environmentName , 'shopify.theme.toml' , { from : flags . path } )
107+ const environmentConfig = await loadEnvironment ( environmentName , 'shopify.theme.toml' , {
108+ from : flags . path ,
109+ silent : true ,
110+ } )
96111 // eslint-disable-next-line no-await-in-loop
97112 sessions [ environmentName ] = await this . ensureAuthenticated ( environmentConfig as FlagValues )
98113 }
@@ -104,7 +119,10 @@ export default abstract class ThemeCommand extends Command {
104119 processes : environments . map ( ( environment : string ) => ( {
105120 prefix : environment ,
106121 action : async ( stdout : Writable , stderr : Writable , _signal ) => {
107- const environmentConfig = await loadEnvironment ( environment , 'shopify.theme.toml' , { from : flags . path } )
122+ const environmentConfig = await loadEnvironment ( environment , 'shopify.theme.toml' , {
123+ from : flags . path ,
124+ silent : true ,
125+ } )
108126 const environmentFlags = {
109127 ...flags ,
110128 ...environmentConfig ,
0 commit comments