如何只选择特定版本来构建我的 satis 项目?
How to pick only specific versions to build inside my satis project?
我不知道 satis
会在其中安装所有版本的包所以基本上这是我的 satis.json 文件
{
"name" :"offline-packages/satis-packages",
"description":"Offline Packages Generator",
"homepage": "https://localhost:3200",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/akaunting/money.git"
},
{
"type": "vcs",
"url": "https://github.com/beyondcode/laravel-confirm-email.git"
},
// ... more repositories here
{
"type": "vcs",
"url": "https://github.com/webpatser/laravel-countries.git"
}],
"require-all": true,
"require-dependencies": true,
"require-dev-dependencies": true,
"archive": {
"directory": "dist"
}
}
但我想要的是仅根据高于特定版本的特定版本安装特定版本,而不是在使用
构建之前安装所有版本
php bin/satis build satis.json web/
您已指定 require-all: true
。
如果您不想要求全部,而是要选择特定版本,则需要在配置中添加适当的 require
键。
来自the docs:
If you want to cherry pick which packages you want, you can list all the packages you want to have in your satis repository inside the classic composer require key, using a "*" constraint to make sure all versions are selected, or another constraint if you want really specific versions.
他们在文档中提供的示例应该足够清楚了:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
{ "type": "vcs", "url": "http://svn.example.org/private/repo" },
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
],
"require": {
"company/package": "*",
"company/package2": "*",
"company/package3": "2.0.0"
}
}
我不知道 satis
会在其中安装所有版本的包所以基本上这是我的 satis.json 文件
{
"name" :"offline-packages/satis-packages",
"description":"Offline Packages Generator",
"homepage": "https://localhost:3200",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/akaunting/money.git"
},
{
"type": "vcs",
"url": "https://github.com/beyondcode/laravel-confirm-email.git"
},
// ... more repositories here
{
"type": "vcs",
"url": "https://github.com/webpatser/laravel-countries.git"
}],
"require-all": true,
"require-dependencies": true,
"require-dev-dependencies": true,
"archive": {
"directory": "dist"
}
}
但我想要的是仅根据高于特定版本的特定版本安装特定版本,而不是在使用
构建之前安装所有版本php bin/satis build satis.json web/
您已指定 require-all: true
。
如果您不想要求全部,而是要选择特定版本,则需要在配置中添加适当的 require
键。
来自the docs:
If you want to cherry pick which packages you want, you can list all the packages you want to have in your satis repository inside the classic composer require key, using a "*" constraint to make sure all versions are selected, or another constraint if you want really specific versions.
他们在文档中提供的示例应该足够清楚了:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
{ "type": "vcs", "url": "http://svn.example.org/private/repo" },
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo2" }
],
"require": {
"company/package": "*",
"company/package2": "*",
"company/package3": "2.0.0"
}
}