If you wan't a cljs
that acts like clj
, but for ClojureScript, there are a few minor changes you can make:
First, add the following entry to ~/.clojure/deps.edn
under the :deps
key:
org.clojure/clojurescript {:mvn/version "1.10.439"}
Then make copies of clj
and clojure
named cljs
and clojurescript
, and put those copies on your path.
For the clojurescript
script, remove the help flag handler and add -m cljs.main
:
$ diff `which clojure` `which clojurescript`
98,105d97
< -h|--help|"-?")
< if [[ ${#main_aliases[@]} -gt 0 ]] || [[ ${#all_aliases[@]} -gt 0 ]]; then
< break
< else
< help=true
< shift
< fi
< ;;
344c336
< exec "$JAVA_CMD" "${jvm_cache_opts[@]}" "${jvm_opts[@]}" "-Dclojure.libfile=$libs_file" -classpath "$cp" clojure.main "${main_cache_opts[@]}" "$@"
---
> exec "$JAVA_CMD" "${jvm_cache_opts[@]}" "${jvm_opts[@]}" "-Dclojure.libfile=$libs_file" -classpath "$cp" clojure.main "${main_cache_opts[@]}" -m cljs.main "$@"
and for the cljs
script, change clojure
to clojurescript
:
$ diff `which clj` `which cljs`
4c4
< exec rlwrap -r -q '\"' -b "(){}[],^%#@\";:'" clojure "$@"
---
> exec rlwrap -r -q '\"' -b "(){}[],^%#@\";:'" clojurescript "$@"