Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support restoring files when cleaner-ignore is changed #12

Open
JanTvrdik opened this issue Jun 13, 2017 · 5 comments
Open

Support restoring files when cleaner-ignore is changed #12

JanTvrdik opened this issue Jun 13, 2017 · 5 comments

Comments

@JanTvrdik
Copy link
Contributor

JanTvrdik commented Jun 13, 2017

  • bug report? no
  • feature request? yes

I don't know if this can actually be solved but I think it's worth looking into. Currently if cleaner removed too much stuff, you modify cleaner-ignore. Calling composer update / composer update however does not restore the deleted files.

It would be nice if composer-cleaner could detect that cleaner-ignore was changed and force Composer to reinstall the library.

@dg
Copy link
Owner

dg commented Jun 13, 2017

I will never want to solve something just a little complicated :-) So feel free to suggest PR, issues will not work.

@JanTvrdik
Copy link
Contributor Author

I hope that @CzechBoy will do it.

I propose the following approach to the problem:
After install or update store the current cleaner-ignore configuration somewhere in vendor directory.
Next time in beforeInstall / beforeUpdate event compare it and rm -rf directories of packages for which cleaner-ignore definition changed.

@adaamz
Copy link

adaamz commented Jun 13, 2017

@JanTvrdik so folders are never removed but only moved to some subdirectory in vendor? I don't think that this is goal of this library.

There should be some force reinstall command in composer... then for each ignored library (with not found ignored directories) should be then reinstalled and cleaned again.

@enumag
Copy link

enumag commented Jun 13, 2017

@CzechBoy No, that's not what @JanTvrdik meant. Only the configuration file for cleaner should be stored somewhere. That way you can figure out the changes in the configuration when you do the next clean and remove the directories with packages that need reinstallation. That way you'll force intalling it again.

@adaamz
Copy link

adaamz commented Jun 13, 2017

@enumag ah, so save last composer.json (or at least the cleaner part) for later comparison. next update/install it should compare this old and current configuration and force reinstall of packages as mentioned in my previous message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants