Skip to content

Commit

Permalink
Allow connecting to a custom browser via cljs-repl
Browse files Browse the repository at this point in the history
First argument to `script/cljs-repl` is treated as a browser's
executable. No arguments triggers default browser (as before).
  • Loading branch information
dm3 committed Jan 12, 2012
1 parent e23834f commit 7e5a97e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions script/cljs-repl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7e5a97e

Please sign in to comment.