Replies: 8 comments 26 replies
-
Nice idea. It's interesting how it passes sandbox escape permissions as part of the install. This could be done for the JVM but I can't think of an application of it outside of applets. It might be good to version it in case you decide to break compatibility with flags passed and disk layout after more people try it out. |
Beta Was this translation helpful? Give feedback.
-
Interesting. Really liking the idea of Example if
No comments on dependencies -- I haven't used those yet. All dependencies I'm using for now are in the script with Personally I prefer |
Beta Was this translation helpful? Give feedback.
-
It would be nice if there was a way for the remote to provide information about available versions, so that you could ask "are there updates?", "I'd like to update this thing" or "I'd like to update everything" locally. |
Beta Was this translation helpful? Give feedback.
-
I would also like there to be a file I can track in my dotfiles with all my scripts.
Could for example be |
Beta Was this translation helpful? Give feedback.
-
That's very similar to clojure cli. maybe we already can do it with
o... one difference would be the ability to sandbox the script |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to support inferring the URL from the lib name, with similar options as
In this case we would still be installing a top-level script even though it's using a GitHub URL internally. For completeness we'd also want to support all the "lib to url" cases here. |
Beta Was this translation helpful? Give feedback.
-
Here's a draft that works for local scripts. Local scripts must have a Works by generating a shell script wrapper in Not sure whether this contributes anything to the discussion, but there's working code and a CLI draft. |
Beta Was this translation helpful? Give feedback.
-
@borkdude @teodorlu: This last week I've been working on a "batteries-included" tool to install all existing Babashka projects and scripts, with support for both local and remote deps. I took care to ensure there is no external metadata in my implementation, meaning all the state is in the I've been using this tool myself to install all the Babashka scripts and projects I use. I was able to reuse the deps inference functions from I think even if this Here's an example of how it looks. These commands are fully functional for me with my unreleased code right now:
;; Output of `bbin ls` with my current installed scripts:
{http-server {:coords {:git/sha "3906760b88d8aa77237f6537c44dd84669179edd",
:git/tag "v0.1.11",
:git/url "https://github.com/babashka/http-server"},
:lib io.github.babashka/http-server},
neil {:coords {:git/sha "fb9b9a0a432089b5c93868b45e898646ce74504e",
:git/tag "v0.1.43",
:git/url "https://github.com/babashka/neil"},
:lib io.github.babashka/neil},
neil-dev {:coords {:local/root "/Users/rads/src/neil"},
:lib io.github.babashka/neil},
portal {:coords {:http/url "https://gist.githubusercontent.com/rads/da8ecbce63fe305f3520637810ff9506/raw/e83305656f2d145430085d5414e2c3bff776b6e8/portal.clj"}},
watch {:coords {:git/sha "ad6076d3b268efd81c555a246ff0b2fd36350ca6",
:git/tag "v0.0.3",
:git/url "https://github.com/rads/watch"},
:lib io.github.rads/watch}} (I'm still deciding if I should call it |
Beta Was this translation helpful? Give feedback.
-
Deno has an interesting feature where you can install remote scripts as a command line tool:
This creates a shim script in:
with the following contents:
On Windows, in
.deno\bin\file-server.cmd
:We could have a similar story for babashka where you can install
.clj
scripts from a remote repository.For single standalone scripts this would be quite easy:
but as soon as those scripts have dependencies, it might become more complex: here installing an uberjar created with
bb uberjar
is probably the best solution:Another option would be to let bb clone the entire repo as a tool:
with some entrypoint
main.clj
or so - or you would just be able to leverage tasks frombb.edn
from that repo to run directly:So:
.clj
is assumed to be a single standalone script,.jar
is assumed to be a bundled dependency, other extensions are assumed to be a repo to be cloned and invoked with tasks?Beta Was this translation helpful? Give feedback.
All reactions