Skip to content

Commit

Permalink
Warn about lein trampoline being broken on Windows
Browse files Browse the repository at this point in the history
See issue bhauman#682
  • Loading branch information
alexnixon committed May 1, 2018
1 parent 9a91b8b commit 9ea27fe
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions plugin/src/leiningen/figwheel.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
[clojure.java.io :as io]
[clojure.set :refer [intersection]]
[leiningen.figwheel.fuzzy :as fuz]
[simple-lein-profile-merge.core :as lm]))
[simple-lein-profile-merge.core :as lm])
(:import (java.util Locale)))

(def _figwheel-version_ "0.5.16-SNAPSHOT")
(def _rebel-readline-cljs-version_ "0.1.1")
Expand Down Expand Up @@ -454,6 +455,21 @@
(println "Figwheel: Cutting some fruit, just a sec ...")
(fig-dispatch command project build-ids))

(defn- warn-about-broken-trampoline-on-windows []
(when-let [os (System/getProperty "os.name")]
(when (.contains (.toLowerCase os Locale/ENGLISH) "windows")
(println " ---------------------------------- WARNING ----------------------------------- ")
(println "| Figwheel is invoking lein trampoline which doesn't always work on Windows |")
(println "| due to a bug in leiningen. If you see issues around missing dependencies, |")
(println "| corrupt JVM properties or any other strange behaviour then you can disable |")
(println "| trampoline by adding `:readline false` to your server-side `:figwheel` |")
(println "| config in the root of your project.clj |")
(println "| |")
(println "| For more details: |")
(println "| https://github.com/technomancy/leiningen/issues/982 |")
(println "| https://github.com/bhauman/lein-figwheel/issues/682 |")
(println " ------------------------------------------------------------------------------ "))))

(defn figwheel
"Figwheel - a tool that helps you compile and reload ClojureScript.
Expand Down Expand Up @@ -542,5 +558,7 @@ Configuration:
(get-in project [:figwheel :readline] true))
(if tramp/*trampoline?*
(launch-figwheel command project build-ids)
(apply tramp/trampoline project "figwheel" command-and-or-build-ids))
(do
(warn-about-broken-trampoline-on-windows)
(apply tramp/trampoline project "figwheel" command-and-or-build-ids)))
(launch-figwheel command project build-ids))))))

0 comments on commit 9ea27fe

Please sign in to comment.