I am trying to automate the updating of private custom plugins. I found this question: Updates for a private plugin?, which works brilliantly. I have the zip files on a website and WordPress detects the upgrade to the plugin and the user can then ask for the update.
The problem I am having is that GitHub adds the version onto the plugin directory, once it is upzipped so:
myplugin->myplugin-1.9
Because of this feature of GitHub, WordPress thinks it is a new plugin and the user has to re-activate it after the update.
UPDATE
I have since watched the code run in WP_Upgrader and there doesn't seem to be a hook or filter in which I can change the final directory for the plugin.
I did add some code to the filter upgrader_post_install to rename the directory, which worked, but too hacky for a final solution.
I do not see a moment where I can hop in and ask the directory be changed from myplugin-1.9 to myplugin. I have reached the conclusion for now, that I will instead build the zip file myself to ensure it does not have the version number.