Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
lessc watcher in Clojure
(ns lessc
(:require [pro.juxt.dirwatch :refer (watch-dir)]
[ :refer (file)]
[clojure.core.async :as a]))
(defn run-less []
(println "Running LESS")
(ProcessBuilder. ["lessc" "resources/bootstrap/assets/mybootstrap.less" "resources/public/s.css"])
(.redirectOutput java.lang.ProcessBuilder$Redirect/INHERIT)
(-> .start .waitFor))
(println "Finishing LESS"))
(defn process-watch [c]
(println "Starting")
(loop []
(a/<!! c)
(println "Files Changed")
(defn watch []
(let [c (a/chan (a/dropping-buffer 1))
f (file "/home/julian/handel/resources/bootstrap/assets/")]
(watch-dir #(a/>!! c %) f)
(future (process-watch c))))

This comment has been minimized.

Copy link

ghost commented Jul 5, 2014

Thanks! Otherwise I never would have found out there should be $ in between ProcessBuilder.Redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.