Open Youdaman opened 3 years ago
Actually, I just noticed that if I do things using the repo method instead of vcs, it initially puts the plugin in wp-content/plugins/foo/foo.php and then just moves foo.php to wp-content/mu-plugins/foo.php and leaves behind the original directory in wp-content/plugins/foo/
The difference between the repo vs vcs methods then becomes that the repo method has an empty folder left behind while the vcs method has the composer.json and .git/ and .gitignore, so I guess that's just because the repo method doesn't fetch/install these files.
So it looks like the behaviour is probably working as expected and I need to work out whether I want to delete the original directories somehow.
I did spot the following in Dropin.php so I guess that was an idea you had already:
#We could Remove original directories but don't do it
#unlink($src);
If you add an opt-in option for the delete and document it in readme and add unit test for it I'm willing to merge it 👍
Hi, I have a repo setup using SatisPress where I have a custom plugin that has the following file structure:
foo/
If I setup my website's composer.json with the following:
Then it installs the plugin as an muplugin correctly, i.e. it ends up having only wp-content/mu-plugins/foo.php
However if I set it up using git instead:
and
When it installs it leaves behind the original directory, i.e. wp-content/mu-plugins/foo.php along with wp-content/mu-plugins/foo/ (and in that directory is the composer.json, .git/ and .gitignore).
So in summary, pulling from a repo works as expected, moving the specified file and deleting the original directory, but pulling from vcs/git does not delete the original directory after the move.