File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
modules/packages/composer Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ type Metadata struct {
4848 Homepage string `json:"homepage,omitempty"`
4949 License Licenses `json:"license,omitempty"`
5050 Authors []Author `json:"authors,omitempty"`
51+ Bin []string `json:"bin,omitempty"`
5152 Autoload map [string ]any `json:"autoload,omitempty"`
5253 AutoloadDev map [string ]any `json:"autoload-dev,omitempty"`
5354 Extra map [string ]any `json:"extra,omitempty"`
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments