Skip to content

Instantly share code, notes, and snippets.

@ohpauleez
Forked from cemerick/usage.sh
Created October 5, 2012 15:51
Show Gist options
  • Save ohpauleez/3840648 to your computer and use it in GitHub Desktop.
Save ohpauleez/3840648 to your computer and use it in GitHub Desktop.
leiningen.fork
(ns leiningen.fork
(:require [leiningen.core.main :as main]
[leiningen.do :as do]))
(defn fork
[project task-name & args]
(apply println "Forking" task-name args)
(future
(main/apply-task (main/lookup-alias task-name project) project args)))
# nice to add as an alias
$ lein do fork cljx auto, fork cljsbuild auto, repl :headless
Forking cljx auto
Forking cljsbuild auto
Compiling ClojureScript.
Watching [src/cljx] for changes.
Rewriting src/cljx to target/classes (clj) with 2 rules.
Rewriting src/cljx to target/generated/cljs (cljs) with 7 rules.
Compiling "target/classes/compiled/cljs/xxx.js" from "src/cljs"...
nREPL server started on port 56260
Successfully compiled "target/classes/compiled/cljs/xxx.js" in 9.704333 seconds.
# Connect to the REPL from any nREPL client
# Any changes to .cljs or .cljx files will be picked up for recompilation automatically
# (no need for separate cljsc / REPL processes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment