From afd8bf2be3eabeb98105db85899ab8aabc9d17b6 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Sun, 24 Sep 2023 19:29:58 +0000 Subject: [PATCH] fix: snippet merging for app installations --- cmd/project/ci.go | 2 +- extension/bundle.go | 2 +- extension/bundle_test.go | 4 ++-- extension/project.go | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/project/ci.go b/cmd/project/ci.go index 6c50fd04..3d24d8e5 100644 --- a/cmd/project/ci.go +++ b/cmd/project/ci.go @@ -303,7 +303,7 @@ func cleanupAdministrationFiles(ctx context.Context, folder string) error { logging.FromContext(ctx).Infof("Migrating generated snippet file for %s", folder) - snippetFolder := path.Join(adminFolder, "src", "snippet") + snippetFolder := path.Join(adminFolder, "src", "app", "snippet") if err := os.MkdirAll(snippetFolder, os.ModePerm); err != nil { return err } diff --git a/extension/bundle.go b/extension/bundle.go index 65912910..a3aef2b9 100644 --- a/extension/bundle.go +++ b/extension/bundle.go @@ -71,7 +71,7 @@ type shopwareBundleComposerJsonExtra struct { // GetRootDir returns the src directory of the bundle. func (p ShopwareBundle) GetRootDir() string { - return p.path + return path.Join(p.path, "src") } // GetResourcesDir returns the resources directory of the shopware bundle. diff --git a/extension/bundle_test.go b/extension/bundle_test.go index d725812a..4340afe3 100644 --- a/extension/bundle_test.go +++ b/extension/bundle_test.go @@ -72,9 +72,9 @@ func TestCreateBundle(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "TestBundle", name) - assert.Equal(t, dir, bundle.GetRootDir()) + assert.Equal(t, path.Join(dir, "src"), bundle.GetRootDir()) assert.Equal(t, dir, bundle.GetPath()) - assert.Equal(t, path.Join(dir, "Resources"), bundle.GetResourcesDir()) + assert.Equal(t, path.Join(dir, "src", "Resources"), bundle.GetResourcesDir()) assert.Equal(t, TypeShopwareBundle, bundle.GetType()) _, err = bundle.GetChangelog() diff --git a/extension/project.go b/extension/project.go index 65254dd3..49d1aeb4 100644 --- a/extension/project.go +++ b/extension/project.go @@ -64,6 +64,8 @@ func FindAssetSourcesOfProject(ctx context.Context, project string) []asset.Sour name = filepath.Base(bundlePath) } + logging.FromContext(ctx).Infof("Found bundle in project: %s (path: %s)", name, bundlePath) + sources = append(sources, asset.Source{ Name: name, Path: path.Join(project, bundlePath),