drupal-composer / preserve-paths

A composer plugin for keeping specified files and directories when installing/updating new composer packages. Can be used to supported nested packages.
28 stars 28 forks source link

preserve-path not retaining the directories whenever composer update or install action #41

Open sandykadam opened 2 years ago

sandykadam commented 2 years ago

I'm using latest version of preserve-path i.e 0.1.6.

I have following code for my D7 project:


 "installer-paths": {
      "dist/": [ "type:drupal-core" ],
      "dist/sites/all/libraries/{$name}": [ "type:drupal-library"],
      "dist/sites/all/modules/custom/{$name}": [ "type:drupal-custom-module" ],
      "dist/sites/all/modules/contrib/{$name}": [ "type:drupal-module" ],
      "dist/sites/all/themes/shared/{$name}": [ "type:drupal-custom-theme" ],
      "dist/sites/all/themes/contrib/{$name}": [ "type:drupal-theme" ]
    },
    "preserve-paths": [
      "dist/sites/myproject.com
    ]

There are already custom modules in dist/sites/myproject.com/modules/custom/module_name location which needs to be there everytime but whenever I do composer update or install it removes "dist" directory and again setup. It is not preserving the path which I have define to preserve.

driskell commented 1 year ago

Can you provide your module require list. And try changing preserve paths to just the module and theme folders to preserve rather than the top level tree?

I reported an issue with meta packages and overlapping preserve paths like this in https://github.com/drupal-composer/preserve-paths/issues/42 .

sandykadam commented 1 year ago

Hi @driskell

Thanks for checking. Your comment about adding full path of modules/themes instead of top-level tree how does it differ to the example you gave In your comment https://github.com/drupal-composer/preserve-paths/issues/42#issuecomment-1402183384

There also you have mentioned all instead of sitename but still doesn't work for you.

sandykadam commented 3 months ago

Since there is no activity on this repo, I have created my own forked repo and fixed all the issues, if anybody interested then please use this version https://github.com/sandykadam/preserve-paths/releases/tag/0.4. Tested with PHP8 as well.

composer require sandykadam/preserve-paths