A port of the clojure bash script to Clojure.
This script can be run on the JVM or with babashka. The latter makes it go about as fast as the original bash version.
TBD.
Experimental, breaking changes will happen. Feedback is welcome.
The deps.clj
script adds the following non-standard options:
-Sdeps-file Use this file instead of deps.edn
-Scommand A custom command that will be invoked. Substitutions: {{classpath}}, {{main-opts}}.
Given this script-deps.edn
file:
{:paths ["scripts"]
:aliases
{:main
{:main-opts ["-m" "scripts.main"]}}}
and scripts/main.cljc
:
(ns scripts.main)
(defn -main [& _args]
(println "Hello from script!"))
you can invoke deps.clj
as follows to invoke babashka:
$ deps.clj -Sdeps-file script-deps.edn -A:main -Scommand "bb -cp {{classpath}} {{main-opts}}"
Hello from script!
This can also be used with planck:
$ deps.clj -Sdeps-file script-deps.edn -A:main -Scommand "planck --classpath {{classpath}} {{main-opts}}"
Hello from script!
Copyright © 2019 Michiel Borkent
Distributed under the EPL License. See LICENSE.
This project is based on code from clojure/brew-install which is licensed under the same EPL License.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close