-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ADDON_DATA in addon_config.mk #190
Support ADDON_DATA in addon_config.mk #190
Conversation
thanks! |
Please notice this can cause problem when user "update" existing project. It will overwrite his/her own data resource if the folder name is the same. |
yeah i saw. i guess most people add addons at the beginning before having any data? also data from addons would usually be named in a way that it's obvious won't clash easily with other files i can imagine in any case perhaps we could add a check to see if those files exist and fail it they do? |
I often start a new project and update several times whenever I noticed I need an additional addon. (or I decide I don't need addon already imported)
I expect we can find /data/shader in several addons, also /data/png etc?
We can check existing data folder and cancel copy. But then addon does not work properly because of missing files. I think the best solution is implementing the "merge" feature on ofDirectory. Or we ask addon makers to use a unique folder name. (this sounds a bad idea) |
Or we can disable folder copy and only allow single file copy (like an original PR). |
when i say fail i mean it should show an error so you know that the addon didn't install properly. and yes i think addons with data should have unique folder names like ofxSomething_shaders instead of shaders |
I see, indeed just skipping is a bad idea.
I start thinking B is the best. +edit |
original PR
#92 by @mattfelsen in 2015-16.
additional commit
I checked original PR still works nicely but only able to copy single file.
I added folder copy feature so that we can avoid listing up all files.
Tested on OSX and Windows, both of commandLine and frontend app works okay.
Known problem
If we have same data folder/file in different addon, PG will copy both to /myProject/bin/data but overwrite. For example, considering we have following two addons.
And generate a project which copies both of /data/img. Then /myProject/bin/data/img folder will be overwritten by last addon specified. This might be solved by adding new "merge" feature to ofDirectory class in order to avoid overwrite folder but merge contents.