Skip to content

Instantly share code, notes, and snippets.

@borkdude
Last active Aug 1, 2020
Embed
What would you like to do?
Work dev script
#!/usr/bin/env bb
(ns dev
(:import java.lang.ProcessBuilder$Redirect)
(:require [clojure.java.io :as io]))
(defn cljs []
(let [cmd ["clojure" "-A:cljs/dev"]
pb (doto (ProcessBuilder. cmd)
(.redirectOutput ProcessBuilder$Redirect/INHERIT)
(.redirectError ProcessBuilder$Redirect/INHERIT))
proc (.start pb)]
(-> (Runtime/getRuntime)
(.addShutdownHook (Thread. #(.destroy proc))))
proc))
(defn less []
(let [cmd ["clojure" "-A:less/dev"]
pb (doto (ProcessBuilder. cmd)
(.redirectOutput ProcessBuilder$Redirect/INHERIT)
(.redirectError ProcessBuilder$Redirect/INHERIT))
proc (.start pb)]
(-> (Runtime/getRuntime)
(.addShutdownHook (Thread. #(.destroy proc))))
proc))
(defn clojure []
(let [cmd ["./boot" "dev"]
pb (doto (ProcessBuilder. cmd)
(.inheritIO))
proc (.start pb)]
(-> (Runtime/getRuntime)
(.addShutdownHook (Thread. #(.destroy proc))))
proc))
(cljs)
(less)
(.waitFor (clojure))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment