【发布时间】:2018-03-27 21:51:57
【问题描述】:
我有没有代码但有依赖列表的作曲家项目。我想运行composer install 来下载所有依赖包,然后在每个包中运行一些 bash 命令。
我的 composer.json:
{
"name": "testmain/testmain",
"description": "testmain",
"minimum-stability": "dev",
"repositories": [{
"type": "package",
"package": {
"name": "testsub/testsub1",
"description": "testsub/testsub1",
"version": "master",
"source": {
"url": "https://github.com/testsub/testsub1",
"type": "git",
"reference": "master"
},
"scripts": {
"post-install-cmd": [
"make",
"make install"
]
}
}
},
{
"type": "package",
"package": {
"name": "testsub/testsub2",
"description": "testsub/testsub2",
"version": "master",
"source": {
"url": "https://github.com/testsub/testsub2",
"type": "git",
"reference": "master"
},
"scripts": {
"post-install-cmd": [
"make",
"make install"
]
}
}
}
],
"require": {
"testsub/testsub1": "master",
"testsub/testsub2": "master"
}
}
问题在于运行scripts 嵌套包序列,所有脚本都被作曲家忽略。
谢谢!
【问题讨论】:
-
创建一个作曲家插件可能是你最好的选择:getcomposer.org/doc/articles/plugins.md#creating-a-plugin
标签: git composer-php