Skip to content

Commit e16fbe2

Browse files
committed
remove dead code
1 parent 6abfcd4 commit e16fbe2

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/wisp.wisp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(ns wisp.wisp
22
"Wisp program that reads wisp code from stdin and prints
33
compiled javascript code into stdout"
4-
(:require [fs :refer [createReadStream writeFileSync]]
4+
(:require [fs :refer [createReadStream]]
55
[path :refer [basename dirname join resolve]]
66
[module :refer [Module]]
77
[commander]
88

99
[wisp.string :refer [split join upper-case replace]]
10-
[wisp.sequence :refer [first second last count reduce rest map
10+
[wisp.sequence :refer [first second last count reduce rest
1111
conj partition assoc drop empty?]]
1212

1313
[wisp.repl :refer [start] :rename {start start-repl}]
@@ -29,10 +29,6 @@
2929
compile-string
3030
(conj {:source-uri path} options)))
3131

32-
(defn compile-files
33-
[paths options]
34-
(map #(compile-file % options) paths))
35-
3632
(defn compile-string
3733
[source options]
3834
(let [channel (or (:print options) :code)
@@ -41,10 +37,6 @@
4137
(= channel :code) (:code output)
4238
(= channel :expansion) (:expansion output)
4339
:else (JSON.stringify (get output channel) 2 2))]
44-
(if (and (:output options) (:source-uri options) content)
45-
(writeFileSync (path.join (.-output options) ;; `join` relies on `path`
46-
(str (basename (:source-uri options) ".wisp") ".js"))
47-
content)
4840
(.write process.stdout (or content "nil")))
4941
(if (:error output) (throw (.-error output)))))
5042

@@ -81,14 +73,13 @@
8173
(.option "-c, --compile" "Compile to JavaScript and save as .js files")
8274
(.option "-i, --interactive" "Run an interactive wisp REPL")
8375
(.option "--debug, --print <type>" "Print debug information. Possible values are `expansion`,`forms`, `ast` and `js-ast`")
84-
;(.option "-o, --output <dir>" "Output to specified directory")
8576
(.option "--no-map" "Disable source map generation")
8677
(.parse process.argv))
8778
(set! (aget options "no-map") (not (aget options "map"))) ;; commander auto translates to camelCase
8879
(cond options.run (run (get options.args 0))
8980
(not process.stdin.isTTY) (compile-stdin options)
9081
options.interactive (start-repl)
91-
options.compile (compile-files options.args options)
82+
options.compile (compile-file options.args options)
9283
options.args (run options.args)
9384
:else (start-repl)
9485
)))

0 commit comments

Comments
 (0)