Fork me on GitHub
#babashka
<
2020-10-22
>
borkdude09:10:32

refactoring old java.lang.Process interop code with babashka.process: https://twitter.com/borkdude/status/1319210076469645312

borkdude09:10:25

#!/usr/bin/env bb

(ns dev
  (:require [babashka.process :refer [$ destroy-tree *defaults*]]))

(alter-var-root #'*defaults* assoc
                :out :inherit
                :err :inherit
                :shutdown destroy-tree)

(defn cljs []
  ($ "./clojure" "-A:frontend:cljs/dev"))

(defn less []
  ($ "./clojure" "-A:frontend:less/dev"))

(defn clojure []
  ^{:inherit true} ($ "./boot" "dev"))

(cljs)
(less)
(-> @(clojure) :exit (System/exit))

nate17:10:27

babashka.process is awesome, just cut one of my functions in half and it's easier to understand 🎉