Modify code export to skip frx files
byronwall opened this issue · 6 comments
This is the same issue that is faced over at hilkoc/vbaDeveloper#5.
Probably want a prompt that will not export these files unless a form was actually changed. Seems reasonable to just prompt for this now.
This is still a problem with the current build script. Not sure the best way to get around it. Right now I am just unchecking files that I know were not changed while editing. Ideally, the build script will be able to take care of this. Maybe it can compare the new .vba
files against the old ones and overwrite the "new" ones which don't actually have changes.
Did the new export script fix this?
Not yet. Trying to decide how "automated" this skipping should be. For now, I have just been unchecking these files when they show up in the commit if I know there was no change. That largely defeats the purpose of a version control system though.
The problem seems to be that the frx binary file has some change in it even when there is no corresponding change in the vba/plain text output. I think it's possible to keep a copy of the current/existing vba files and compare them to the new versions. If the plain text of the new and current vba file matches, then it can discard the corresponding frx file and bring back the previous version. That should all be doable by renaming the current /code/
directory to /code-old/
or such, outputting the new files into /code/
, checking the text of the corresponding vba file for each frx file, moving old frx files back if no change, and then deleting the /code-old/
folder.
That sounds easy enough. I assume it would work. I will take a stab at it shortly.
On further thought, this is probably not a good approach. That frx file contains all of the information for UserForm properties and other things which could presumably change without the vba file changing. Might stick to unchecking things for now.
I agree, after having done some commenting in the .frx forms, they needed to be synced and excluding them wouldn't have worked. Manually checking and unchecking would work - but also it might be useful to put an option in the script to exclude .frx - ask the user. If they didn't make changes, then exclude them from the export.
I'll add an option to the build script which makes this prompt. It will ask
- "Do you want to ignore exporting all form files? Yes/No"
- If yes, then it will proceed and skip them all.
- If no, it will ask for each individual file, "Do you want to export Form
WhatsItsName
?" and export accordingly.
I think these prompts will come from Excel and not Powershell just to make it easier.