Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow connecting to a custom browser via cljs-repl

First argument to `script/cljs-repl` is treated as a browser's
executable. No arguments triggers default browser (as before).
  • Loading branch information...
commit 7e5a97e93a329e1c909d7a10f04959db9cb66a2c 1 parent e23834f
@dm3 authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 script/cljs-repl
View
9 script/cljs-repl
@@ -4,10 +4,15 @@ cd `dirname $0`/..
source script/setup_classpath.sh
+BROWSE_URL="(browse-url \"http://localhost:8080/development\")"
+if [[ -n "$1" ]]; then
+ BROWSE_URL="(binding [*open-url-script* \"$1\"] $BROWSE_URL)"
+fi
+
java -server -cp $CLJSC_CP jline.ConsoleRunner clojure.main -e \
"(use '[one.sample.dev-server :only (run-server cljs-repl)])
- (use '[clojure.java.browse :only (browse-url)])
+ (use '[clojure.java.browse :only (browse-url *open-url-script*)])
(run-server)
- (future (Thread/sleep 3000) (browse-url \"http://localhost:8080/development\"))
+ (future (Thread/sleep 3000) $BROWSE_URL)
(cljs-repl)" --repl
Please sign in to comment.
Something went wrong with that request. Please try again.