@@ -10,6 +10,7 @@ import (
10
10
"strings"
11
11
12
12
"github.com/shopware/shopware-cli/extension"
13
+ "github.com/shopware/shopware-cli/logging"
13
14
"github.com/shopware/shopware-cli/shop"
14
15
"github.com/shyim/go-version"
15
16
)
@@ -89,7 +90,7 @@ func GetConfigFromProject(root string) (*ToolConfig, error) {
89
90
return nil , err
90
91
}
91
92
92
- extensions := extension .FindExtensionsFromProject (context .Background (), root )
93
+ extensions := extension .FindExtensionsFromProject (logging . DisableLogger ( context .Background () ), root )
93
94
94
95
sourceDirectories := []string {}
95
96
adminDirectories := []string {}
@@ -128,6 +129,41 @@ func GetConfigFromProject(root string) (*ToolConfig, error) {
128
129
storefrontDirectories = append (storefrontDirectories , getStorefrontFolders (ext )... )
129
130
}
130
131
132
+ var rootComposerJsonData rootComposerJson
133
+
134
+ rootComposerJsonPath := path .Join (root , "composer.json" )
135
+
136
+ file , err := os .Open (rootComposerJsonPath )
137
+
138
+ if err != nil {
139
+ return nil , err
140
+ }
141
+
142
+ defer func () {
143
+ if closeErr := file .Close (); closeErr != nil {
144
+ err = fmt .Errorf ("failed to close composer.json: %w" , closeErr )
145
+ }
146
+ }()
147
+
148
+ if err := json .NewDecoder (file ).Decode (& rootComposerJsonData ); err != nil {
149
+ return nil , err
150
+ }
151
+
152
+ for bundlePath , _ := range rootComposerJsonData .Extra .Bundles {
153
+ sourceDirectories = append (sourceDirectories , path .Join (root , bundlePath ))
154
+
155
+ expectedAdminPath := path .Join (root , bundlePath , "Resources" , "app" , "administration" )
156
+ expectedStorefrontPath := path .Join (root , bundlePath , "Resources" , "app" , "storefront" )
157
+
158
+ if _ , err := os .Stat (expectedAdminPath ); err == nil {
159
+ adminDirectories = append (adminDirectories , expectedAdminPath )
160
+ }
161
+
162
+ if _ , err := os .Stat (expectedStorefrontPath ); err == nil {
163
+ storefrontDirectories = append (storefrontDirectories , expectedStorefrontPath )
164
+ }
165
+ }
166
+
131
167
var validationIgnores []ToolConfigIgnore
132
168
133
169
if shopCfg .Validation != nil {
@@ -154,3 +190,14 @@ func GetConfigFromProject(root string) (*ToolConfig, error) {
154
190
155
191
return toolCfg , nil
156
192
}
193
+
194
+ type rootComposerJson struct {
195
+ Require map [string ]string `json:"require"`
196
+ Extra struct {
197
+ Bundles map [string ]rootShopwareBundle `json:"shopware-bundles"`
198
+ }
199
+ }
200
+
201
+ type rootShopwareBundle struct {
202
+ Name string `json:"name"`
203
+ }
0 commit comments