drustack / composer-preserve-paths
Composer plugin for preserving custom paths and supporting nested packages
Installs: 4 251
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 22
Type:composer-plugin
Requires
- composer-plugin-api: ~1.0
Requires (Dev)
- composer/composer: ~1.0
- phpunit/phpunit: ~5.7
README
Composer plugin for preserving custom paths and supporting nested packages.
This way you can:
- Provide custom files or directories that will not be overwritten on
composer install
orcomposer update
- Place packages within the directory of another package (using a composer installer like composer/installers)
Installation
Simply install the plugin with composer:
$ composer require drustack/composer-preserve-paths:~1.0
Configuration
For configuring the paths you need to set preserve-paths
within the extra
of your root composer.json
.
{
"extra": {
"preserve-paths": [
"web/sites/all/modules/contrib",
"web/sites/all/themes/contrib",
"web/sites/all/libraries",
"web/sites/all/drush",
"web/sites/default/settings.php",
"web/sites/default/files"
]
}
}
Example
An example composer.json using composer/installers:
{
"config": {
"vendor-dir": "vendor"
},
"extra": {
"installer-paths": {
"web/": [
"type:drupal-core"
],
"web/profiles/{$name}/": [
"type:drupal-profile"
],
"web/sites/all/drush/{$name}/": [
"type:drupal-drush"
],
"web/sites/all/libraries/{$name}/": [
"type:drupal-library"
],
"web/sites/all/modules/contrib/{$name}/": [
"type:drupal-module"
],
"web/sites/all/modules/custom/{$name}/": [
"type:drupal-custom-module"
],
"web/sites/all/themes/contrib/{$name}/": [
"type:drupal-theme"
],
"web/sites/all/themes/custom/{$name}/": [
"type:drupal-custom-theme"
]
},
"preserve-paths": [
"web/sites/all/modules/contrib",
"web/sites/all/themes/contrib",
"web/sites/all/libraries",
"web/sites/all/drush",
"web/sites/default/settings.php",
"web/sites/default/files"
]
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/7"
}
],
"require": {
"composer/installers": "~1.0",
"drupal/drupal": "~7.54",
"drupal/views": "3.x-dev",
"drustack/composer-preserve-paths": "~1.0"
}
}
License
Author Information
- Wong Hoi Sing Edison