Skip to content
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

Other ENVs to add as resources #29

Closed
shawnrice opened this issue Jul 30, 2014 · 4 comments
Closed

Other ENVs to add as resources #29

shawnrice opened this issue Jul 30, 2014 · 4 comments

Comments

@shawnrice
Copy link
Owner

Theoretically, it is possible to add other ENVs to the bundler (nodejs, Go, groovy, etc...). Raised by @deanishe in #28.

To do so, we'd have to figure out how to install them into our data directory. Thus, we'd either have to (a) compile them on the user's machine (ouch!), or (b) host our own package installers that would map everything correctly. Further, we'd have to statically link each binary, which is a pain, but not impossible. Lastly, we'd need to make sure that we had versions that would work on at least a few of the versions of OS X that are relevant.

Assuming we got all the above done, then the best way to implement them would be through something like the bash bundler. So the workflow text would be something like:

#!/bin/bash
. <path/to/bundler>
$(AlfredBundler::load_env nodejs) <nodefile>
@deanishe
Copy link
Collaborator

How does that AlfredBundler::load_env nodejs double colon stuff work? (bash is not my strong point).

@shawnrice
Copy link
Owner Author

Turns out the Google's Shell coding style recommends prefixing library functions with LIBRARYNAME::.

Regular bash functions, thus, can have colons in them (who knew?). So, to avoid naming conflicts, I'm removing the older __ prefixes and adding AlfredBundler:: as the prefix. Although, according to the coding standards, that should probably be something like alfred_bundler, but I'm trying to keep some consistency through all of the bundlers.

See AlfredBundler.sh for a partly re-written version of the bash bundler backend that has the library prefixes. Bonus: it now handles all of the icon color conversion calculations natively. Floating point math in bash! Woot.

@shawnrice
Copy link
Owner Author

Oh, here's a more direct answer:

We'd create a function called AlfredBundler::load_env that could take a few predefined environments that we've created, and that would (1) install the environment (which would take forever) and (2) return the path to the main binary.

@shawnrice
Copy link
Owner Author

While I'm still not too sure how I feel about this, I still think that we'd have to compile stand-alone binaries in order to keep these from the rest of the system (and because we can't assume that the user will have the correct dev tools to compile a sandboxed version).

Here are two tools that might help:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants