2015-12-14 22:02:40 +00:00
|
|
|
(ns user
|
|
|
|
(:use [figwheel-sidecar.repl-api :as ra]))
|
2015-12-15 18:08:18 +00:00
|
|
|
;; This namespace is loaded automatically by nREPL
|
|
|
|
|
|
|
|
;; read project.clj to get build configs
|
|
|
|
(def profiles (->> "project.clj"
|
|
|
|
slurp
|
|
|
|
read-string
|
|
|
|
(drop-while #(not= % :profiles))
|
|
|
|
(apply hash-map)
|
|
|
|
:profiles))
|
|
|
|
|
|
|
|
(def cljs-builds (get-in profiles [:dev :cljsbuild :builds]))
|
2015-12-14 22:02:40 +00:00
|
|
|
|
2016-01-24 12:46:34 +00:00
|
|
|
(defn start-figwheel
|
|
|
|
"Start figwheel for one or more builds"
|
|
|
|
[& build-ids]
|
2015-12-14 22:02:40 +00:00
|
|
|
(ra/start-figwheel!
|
2016-01-24 12:46:34 +00:00
|
|
|
{:build-ids build-ids
|
2015-12-15 18:08:18 +00:00
|
|
|
:all-builds cljs-builds})
|
2015-12-14 22:02:40 +00:00
|
|
|
(ra/cljs-repl))
|
|
|
|
|
2016-01-24 12:46:34 +00:00
|
|
|
(defn stop-figwheel
|
|
|
|
"Stops figwheel"
|
2015-12-14 22:02:40 +00:00
|
|
|
[]
|
2016-01-24 12:46:34 +00:00
|
|
|
(ra/stop-figwheel!))
|