drustack/composer-preserve-paths

This package is abandoned and no longer maintained. No replacement package was suggested.

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

1.0.9 2017-02-18 10:14 UTC

This package is auto-updated.

Last update: 2021-03-31 05:20:29 UTC


README

Build Status Coverage Status Latest Stable Version Total Downloads License

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 or composer 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