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 ef6783b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 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,19 @@
(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 you can disable this by setting |")
(println "| `:readline false` 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 +556,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 ef6783b

Please sign in to comment.