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
On 19 Jun 2008, at 10:16, Hans-Joerg Bibiko wrote:
for some bundles I wrote I came across that it would be nice to have a kind of a "init procedure" for bundles. [...]
I think this is not very useful. E.g. user may install via svn, may manually install (w/o doubleclick), may receive an update to an already installed bundle, bundle requirements may change after the update etc.
Better to just have Support/check_dependencies and call that from each command, and that script will then do the necessary prompting e.g. for downloading additional resources.
That said, I am looking into a more formalized dependency system so e.g. the entire Git bundle (sans Help) can be marked to require git, or we can have a bundle require Leopard etc. But these things require rather free-form dependency management and resolution, and already commands can handle that… The benefit will more be in the user interaction department (and removing the per-item require_cmd).
I know it wasn’t exactly requirements you were asking about, just sort of related…
On 24.06.2008, at 23:56, Allan Odgaard wrote:
On 19 Jun 2008, at 10:16, Hans-Joerg Bibiko wrote:
for some bundles I wrote I came across that it would be nice to have a kind of a "init procedure" for bundles. [...]
I think this is not very useful. E.g. user may install via svn, may manually install (w/o doubleclick), may receive an update to an already installed bundle, bundle requirements may change after the update etc.
Better to just have Support/check_dependencies and call that from each command, and that script will then do the necessary prompting e.g. for downloading additional resources.
That said, I am looking into a more formalized dependency system so e.g. the entire Git bundle (sans Help) can be marked to require git, or we can have a bundle require Leopard etc. But these things require rather free-form dependency management and resolution, and already commands can handle that… The benefit will more be in the user interaction department (and removing the per-item require_cmd).
I know it wasn’t exactly requirements you were asking about, just sort of related…
Thanks! Actually I knew it. The possibilities to install a bundle are multifarious, and it's hard to get rid of it.
Best,
--Hans