silverstripe / recipe-plugin

Helper plugin to install Silverstripe recipes
BSD 3-Clause "New" or "Revised" License
11 stars 10 forks source link

composer vendor-expose overwrite folder with broken synlink #11

Open maxime-rainville opened 6 years ago

maxime-rainville commented 6 years ago

Let's say you create a file under app/css/bob.css and update your project composer.json file like this:

{
"extra": {
        "expose": [
            "app/css"
        ]
    }
}

If you run a composer vendor-expose, bob.css and the css will be deleted and a new app/css symlink will be created. That symlink will point to a broken ../../../app/css location.

maxime-rainville commented 6 years ago

Setting impact as high because it destroy files.

xini commented 6 years ago

Confirming this on Windows. It seems that app/css is just deleted on Windows though. On Mac and Ubuntu it seems to be working.

Update: an update to the latest composer version has fixed this for me.

wilr commented 5 years ago

@maxime-rainville I can confirm this still happens unfortunately! Updating to latest composer (1.8.6 doesn't help)

b-rhodes commented 4 years ago

I duplicated this as well, but only when there was an existing symlink to a containing folder. In my case I changed from:

"expose": [
    "themes/base"
],

to this:

"expose": [
    "themes/base/build",
    "themes/base/images",
    "themes/base/icons",
    "themes/base/fonts"
],

To fix this, I manually removed the symlink to themes/bos, made the changes, then ran composer vendor-expose and it worked fine.