-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathtools.clj
More file actions
34 lines (28 loc) · 1.04 KB
/
tools.clj
File metadata and controls
34 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(require '[clojure.java.shell :as shell]
'[cljs.build.api :as api]
'[cljs.repl :as repl]
'[cljs.repl.node :as node])
(require '[rebel-readline.core]
'[rebel-readline.clojure.line-reader]
'[rebel-readline.cljs.service.local]
'[rebel-readline.cljs.repl])
(defmulti task first)
(defmethod task :default
[args]
(let [all-tasks (-> task methods (dissoc :default) keys sort)
interposed (->> all-tasks (interpose ", ") (apply str))]
(println "Unknown or missing task. Choose one of:" interposed)
(System/exit 1)))
(defmethod task "repl:node"
[args]
(rebel-readline.core/with-line-reader
(rebel-readline.clojure.line-reader/create
(rebel-readline.cljs.service.local/create))
(cljs.repl/repl
(node/repl-env)
:prompt (fn []) ;; prompt is handled by line-reader
:read (rebel-readline.cljs.repl/create-repl-read)
:output-dir "out/repl"
:cache-analysis false)))
;;; Build script entrypoint. This should be the last expression.
(task *command-line-args*)