Work Item #278 - I'll work on this item

Mar 24, 2011 at 7:52 PM

Just want to let you know that I have a functioning PackageFileTransformer to provide overwrite of a file functionality. Similar to what is requested in Work Item #278.

I will create the fork add in the code and do a pull request this weekend.

Developer
Mar 24, 2011 at 11:38 PM
Edited Mar 24, 2011 at 11:38 PM

That seems like the wrong way to fix that issue. A simple boolean would work right?

Mar 25, 2011 at 5:02 PM

Can you expand on what you mean ?

Developer
Mar 25, 2011 at 5:04 PM

You said you wrote a PackageFileTransformer to allow overwrite functionality? I'm wondering what that looks like. Is it a specific extension you use to indicate overwrite vs not?

Mar 25, 2011 at 5:26 PM

Yes, I created an .ow extension, and it will make a backup of the existing file (for uninstall purposes) by adding _old. Then it will do the preprocessor replacement and save the file with the contents from the package.  If the file doesn't currently exist in the project, it simply creates the file.  When uninstall is requested, it will look for the _old, if it's not there it will skip and indicate a warning message to the console.

Developer
Mar 25, 2011 at 5:28 PM

So the decision of overwriting is up to the package author not the consumer, hmmm.

Mar 25, 2011 at 5:39 PM

It creates a backup by appending _old to the file, so the file still exists.  If the consumer wants to get rid of the contents of the new file they simply delete the ones put in the project by the package and remove the _old from the backup of their file.

Still pretty new at this, is there infrastructure for me to prompt a user if they want a file overwritten  that works both in the plugin and console ?

Developer
Mar 25, 2011 at 10:30 PM

This code path doesn't get used in the console.