diff options
author | Giteabot <teabot@gitea.io> | 2024-09-23 02:42:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-22 18:42:02 +0000 |
commit | 73066e3f97d4bf287bd8d506bab7f13ba4155c2c (patch) | |
tree | 6714c7a135385255257902b53c60adb64a9f9f14 /tests | |
parent | 919b82461aa3bf9581f6e9e95ddc1ed16c17290b (diff) | |
download | gitea-73066e3f97d4bf287bd8d506bab7f13ba4155c2c.tar.gz gitea-73066e3f97d4bf287bd8d506bab7f13ba4155c2c.zip |
Add bin to Composer Metadata (#32099) (#32106)
Backport #32099 by @maantje
This PR addresses the missing `bin` field in Composer metadata, which
currently causes vendor-provided binaries to not be symlinked to
`vendor/bin` during installation.
In the current implementation, running `composer install` does not
publish the binaries, leading to issues where expected binaries are not
available.
By properly declaring the `bin` field, this PR ensures that binaries are
correctly symlinked upon installation, as described in the [Composer
documentation](https://getcomposer.org/doc/articles/vendor-binaries.md).
Co-authored-by: Jamie Schouten <j4mie@hey.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/api_packages_composer_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/integration/api_packages_composer_test.go b/tests/integration/api_packages_composer_test.go index 6e0d2eee1b..51b047ab41 100644 --- a/tests/integration/api_packages_composer_test.go +++ b/tests/integration/api_packages_composer_test.go @@ -36,6 +36,7 @@ func TestPackageComposer(t *testing.T) { packageType := "composer-plugin" packageAuthor := "Gitea Authors" packageLicense := "MIT" + packageBin := "./bin/script" var buf bytes.Buffer archive := zip.NewWriter(&buf) @@ -49,6 +50,9 @@ func TestPackageComposer(t *testing.T) { { "name": "` + packageAuthor + `" } + ], + "bin": [ + "` + packageBin + `" ] }`)) archive.Close() @@ -210,6 +214,8 @@ func TestPackageComposer(t *testing.T) { assert.Len(t, pkgs[0].Authors, 1) assert.Equal(t, packageAuthor, pkgs[0].Authors[0].Name) assert.Equal(t, "zip", pkgs[0].Dist.Type) - assert.Equal(t, "7b40bfd6da811b2b78deec1e944f156dbb2c747b", pkgs[0].Dist.Checksum) + assert.Equal(t, "4f5fa464c3cb808a1df191dbf6cb75363f8b7072", pkgs[0].Dist.Checksum) + assert.Len(t, pkgs[0].Bin, 1) + assert.Equal(t, packageBin, pkgs[0].Bin[0]) }) } |