 (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 -main [& args]
  (alter-var-root #'cli/default-commands cli/add-commands figwheel-commands)
  (try
    (let [[pre post] (split-with (complement #{"-re" "--repl-env"}) args)
          args' (if (empty? post) (concat ["-re" "figwheel"] args) args)
          args' (if (empty? args) (concat args' ["-r"]) args')]
      (with-redefs [cljs.cli/default-compile default-compile]
        (apply cljs.main/-main args')))
    (catch Throwable e

              end-parts (fw-util/path-parts (:relative-path source))]
          (when (= end-parts (take-last (count end-parts) res))
            (str (apply io/file (drop-last (count end-parts) res)))))))))

(def default-main-repl-index-body
  (str
