3

使用 Composer 从 VCS 存储库加载包时,有没有办法指定将内容安装到哪个文件夹(类似于git clone <directory>)?

例如回购是:

https://github.com/organization/plugin_name.git

因此作曲家文件读取:

"repositories": [
    {
    "type": "vcs",
          "url": "https://github.com/organization/plugin_name.git"
}]

"require": {
"organization/plugin_name": "dev-master",
}

而我希望内容所在的目录不是“plugin_name”,而是“organization_plugin-title”之类的目录。

我有几个 repos(自定义 WP 插件)在我的 WordPress MU 设置中有一个名称,但文件夹名称不同,我真的不想在更新我的作曲家文件后在管理员中手动启用每个。

4

1 回答 1

3

发布后自然回答了我自己的问题...

在 repo 的 composer.json 文件中,“名称”字段应该是您希望在安装时调用的目录。我错误地认为它必须是回购的名称。

然后确保编辑本地安装的 composer.json 文件,因此在“必需”部分下,它与 repo 的 composer.json 文件中看到的名称相同

于 2015-02-10T18:12:40.370 回答