@@ -14,8 +14,13 @@ import (
1414
1515func validateStorefrontSnippets (context * ValidationContext ) {
1616 rootDir := context .Extension .GetRootDir ()
17- if err := validateStorefrontSnippetsByPath (rootDir , rootDir , context ); err != nil {
18- return
17+
18+ for _ , val := range context .Extension .GetResourcesDirs () {
19+ storefrontFolder := path .Join (val , "snippet" )
20+
21+ if err := validateStorefrontSnippetsByPath (storefrontFolder , rootDir , context ); err != nil {
22+ return
23+ }
1924 }
2025
2126 for _ , extraBundle := range context .Extension .GetExtensionConfig ().Build .ExtraBundles {
@@ -27,15 +32,15 @@ func validateStorefrontSnippets(context *ValidationContext) {
2732 bundlePath = path .Join (bundlePath , extraBundle .Name )
2833 }
2934
30- if err := validateStorefrontSnippetsByPath (bundlePath , rootDir , context ); err != nil {
35+ storefrontFolder := path .Join (bundlePath , "Resources" , "snippet" )
36+
37+ if err := validateStorefrontSnippetsByPath (storefrontFolder , rootDir , context ); err != nil {
3138 return
3239 }
3340 }
3441}
3542
36- func validateStorefrontSnippetsByPath (extensionRoot , rootDir string , context * ValidationContext ) error {
37- snippetFolder := path .Join (extensionRoot , "Resources" , "snippet" )
38-
43+ func validateStorefrontSnippetsByPath (snippetFolder , rootDir string , context * ValidationContext ) error {
3944 if _ , err := os .Stat (snippetFolder ); err != nil {
4045 return nil //nolint:nilerr
4146 }
@@ -110,8 +115,13 @@ func validateStorefrontSnippetsByPath(extensionRoot, rootDir string, context *Va
110115
111116func validateAdministrationSnippets (context * ValidationContext ) {
112117 rootDir := context .Extension .GetRootDir ()
113- if err := validateAdministrationByPath (rootDir , rootDir , context ); err != nil {
114- return
118+
119+ for _ , val := range context .Extension .GetResourcesDirs () {
120+ adminFolder := path .Join (val , "app" , "administration" )
121+
122+ if err := validateAdministrationByPath (adminFolder , rootDir , context ); err != nil {
123+ return
124+ }
115125 }
116126
117127 for _ , extraBundle := range context .Extension .GetExtensionConfig ().Build .ExtraBundles {
@@ -123,15 +133,15 @@ func validateAdministrationSnippets(context *ValidationContext) {
123133 bundlePath = path .Join (bundlePath , extraBundle .Name )
124134 }
125135
126- if err := validateAdministrationByPath (bundlePath , rootDir , context ); err != nil {
136+ adminFolder := path .Join (bundlePath , "Resources" , "app" , "administration" )
137+
138+ if err := validateAdministrationByPath (adminFolder , rootDir , context ); err != nil {
127139 return
128140 }
129141 }
130142}
131143
132- func validateAdministrationByPath (extensionRoot , rootDir string , context * ValidationContext ) error {
133- adminFolder := path .Join (extensionRoot , "Resources" , "app" , "administration" )
134-
144+ func validateAdministrationByPath (adminFolder , rootDir string , context * ValidationContext ) error {
135145 if _ , err := os .Stat (adminFolder ); err != nil {
136146 return nil //nolint:nilerr
137147 }
0 commit comments