Skip to content

Commit

Permalink
fix: snippet merging for app installations
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Sep 24, 2023
1 parent 5e433fd commit afd8bf2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/project/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion extension/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions extension/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions extension/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit afd8bf2

Please sign in to comment.