Hi,
for some bundles I wrote I came across that it would be nice to have a kind of a "init procedure" for bundles.
I'm thinking about to have a standard subfolder called "_INIT_" in a bundle. If that subfolder exists all scripts inside of that subfolder will be executed while installing that bundle (meaning double-click at X.tmbundle, or "Reload Bundles", or TM starts). It should be added a marker that indicates that the init procedure was done to avoid to call these scripts more than once. This init scripts should be execute inside of the bundle environment (to e.g. interpret $TM_BUNDLE_SUPPORT correctly).
This could be helpful for instance: - to check dependencies of libs, files, versions of executables, OS version etc. and give an alert if something mismatches - to set up/build/unzip bundle specific files (useful to minimize the bundle size while downloading) - to install a specific environment used by the bundle's commands (e.g. for the Rdaemon, it will install Rdaemon while installing the bundle) - to ask the user if a file is missing to download it and to install it
I do not know if that request is specific to me. And I do not know what kind of consequences will arise, esp. to check e.g. a text file was changed inside of the bundle which is the source to built an index file.
Of course, it could also be a security issue.
Furthermore if these init scripts always will execute if TM starts it could be used to check if an update is available for the given bundle.
Are there any comments on that?
Thanks,
--Hans