2016-02-26 78 views
1

如何將git repo放置在自定義路徑中?我正在使用作曲家/安裝程序。並且我已經開發了一個關於git repo的模塊。我想將它添加到composer.json中,但在拉動它之後,它應該放置在web/modules/custom目錄中。我怎樣才能做到這一點。作曲家將git repo放置在自定義路徑

我在composer.json

"repositories": [ 
    { 
     "type": "vcs", 
     "url": "https://github.com/miteshmap/axelerant_custom" 
    } 
], 
"require": { 
    "miteshmap/axelerant_custom": "*" 
}, 
"extra": { 
    "installer-paths": { 
     "web/core": ["type:drupal-core"], 
     "web/modules/contrib/{$name}": ["type:drupal-module"], 
     "web/modules/custom/{$name}": ["type:drupal-module"], 
     "web/profiles/contrib/{$name}": ["type:drupal-profile"], 
     "web/themes/contrib/{$name}": ["type:drupal-theme"], 
     "drush/contrib/{$name}": ["type:drupal-drush"] 
    } 
} 

回答

0

在你的倉庫在composer.json文件中添加這部分在GitHub上,你需要編輯名稱"miteshmap/commerce",改變類型作爲規則"web/modules/contrib/{$name}": ["type:drupal-module"],目前將其放置在該文件夾和要求"composer/installers": "~1.0"

{ 
    "name": "miteshmap/commerce", 
    "type": "my-repo", 
    "require": { 
     "composer/installers": "~1.0" 
    } 
} 

其餘的代碼看起來不錯。

+0

看起來像OP改變了他的問題 – cmorrissey

+0

它是一樣的,只是取代了「網絡/模塊/自定義/ {$名稱}」:[「類型:Drupal模塊」], – miteshmap

相關問題