How can I prevent my plugin updates from clobbering the user edits and file additions in a particular subdirectory of my plugin?
I wrote a syntax highlighting plugin that makes use of GeSHi. A sub folder of the plugin is GeSHi itself. Many users will want to customize / edit the language files within GeSHi.
Specifically here is the directory structure:
- several subdirectories etc
- users are going to add files to this directory
- they will also edit files in this directory
- when they pick up their new updates I don't want to erase their edits
What's the best way of solving this?
Here's what I was thinking, but I don't know how to implement:
- On the update plugin action hook (?) make a temporary copy of the files I want to preserve.
- Get the new version unzip and install like usual
- Copy the preserved files from the temp copy to the new version
- Remove the temp copy
Ideally this would all be done with files, but worst case scenario I could save data to the DB.