Skip to content

Commit 58fce56

Browse files
author
dnolen
committed
validate the watch option
1 parent f582f26 commit 58fce56

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/clojure/cljs/cli.clj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@ classpath. Classpath-relative paths have prefix of @ or @/")
144144

145145
(defn- watch-opt
146146
[cfg path]
147+
(when-not (.exists (io/file path))
148+
(if (or (string/starts-with? path "-")
149+
(string/blank? path))
150+
(throw
151+
(ex-info
152+
(str "Missing watch path")
153+
{:cljs.main/error :invalid-arg}))
154+
(throw
155+
(ex-info
156+
(str "Watch path " path " does not exist")
157+
{:cljs.main/error :invalid-arg}))))
147158
(assoc-in cfg [:options :watch] path))
148159

149160
(defn- optimize-opt

0 commit comments

Comments
 (0)