Skip to content

Commit 9ffb2fa

Browse files
authored
Merge branch 'release/v1.22' into backport-32102-v1.22
2 parents 9215407 + 73066e3 commit 9ffb2fa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modules/packages/composer/metadata.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type Metadata struct {
4343
Homepage string `json:"homepage,omitempty"`
4444
License Licenses `json:"license,omitempty"`
4545
Authors []Author `json:"authors,omitempty"`
46+
Bin []string `json:"bin,omitempty"`
4647
Autoload map[string]any `json:"autoload,omitempty"`
4748
AutoloadDev map[string]any `json:"autoload-dev,omitempty"`
4849
Extra map[string]any `json:"extra,omitempty"`

tests/integration/api_packages_composer_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestPackageComposer(t *testing.T) {
3636
packageType := "composer-plugin"
3737
packageAuthor := "Gitea Authors"
3838
packageLicense := "MIT"
39+
packageBin := "./bin/script"
3940

4041
var buf bytes.Buffer
4142
archive := zip.NewWriter(&buf)
@@ -49,6 +50,9 @@ func TestPackageComposer(t *testing.T) {
4950
{
5051
"name": "` + packageAuthor + `"
5152
}
53+
],
54+
"bin": [
55+
"` + packageBin + `"
5256
]
5357
}`))
5458
archive.Close()
@@ -210,6 +214,8 @@ func TestPackageComposer(t *testing.T) {
210214
assert.Len(t, pkgs[0].Authors, 1)
211215
assert.Equal(t, packageAuthor, pkgs[0].Authors[0].Name)
212216
assert.Equal(t, "zip", pkgs[0].Dist.Type)
213-
assert.Equal(t, "7b40bfd6da811b2b78deec1e944f156dbb2c747b", pkgs[0].Dist.Checksum)
217+
assert.Equal(t, "4f5fa464c3cb808a1df191dbf6cb75363f8b7072", pkgs[0].Dist.Checksum)
218+
assert.Len(t, pkgs[0].Bin, 1)
219+
assert.Equal(t, packageBin, pkgs[0].Bin[0])
214220
})
215221
}

0 commit comments

Comments
 (0)