 (defn repl-main-opt [repl-env-fn args cfg]
   (let [target-on-classpath?
         (when-let [target-dir
-                   (try (:target-dir (read-string (slurp "figwheel-main.edn")) "target")
-                        (catch Throwable t
-                          nil))]
+                   (:target-dir
+                    (try (read-string (slurp "figwheel-main.edn"))
+                         (catch Throwable t
+                           nil))
+                    "target")]
           (fw-util/dir-on-classpath? target-dir))
         temp-dir (when-not target-on-classpath?
                    (let [tempf (java.io.File/createTempFile "figwheel" "repl")]

(defn figwheel-opt [cfg bl]
  (assoc-in cfg [::config :figwheel-core] (not= bl "false")))

(defn get-build [bn]
  (let [fname (str bn ".cljs.edn")
        build (try (read-string (slurp fname))
                   (catch Throwable t
                     ;; TODO use error parsing here to create better error message
                     (throw
                      (ex-info (str "Couldn't read the build file: " fname " : " (.getMessage t))
                               {:cljs.main/error :invalid-arg}
                               t))))]
    (when (meta build)
      (when-not (false? (:validate-config (meta build)))
        (log/debug "Validating metadata in build: " fname)

        [clojure.java.io :as io]
        [clojure.pprint :refer [pprint]]
        [clojure.string :as string]
        [clojure.edn :as edn]
        [clojure.tools.reader.edn :as redn]
        [clojure.tools.reader.reader-types :as rtypes]
        [figwheel.core :as fw-core]
        [figwheel.main.ansi-party :as ansip]
        [figwheel.main.logging :as log]
