diff --git a/plugin/src/leiningen/figwheel.clj b/plugin/src/leiningen/figwheel.clj index df7bd9f0..0dcb5e41 100644 --- a/plugin/src/leiningen/figwheel.clj +++ b/plugin/src/leiningen/figwheel.clj @@ -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") @@ -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. @@ -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))))))