 (ns figwheel-sidecar.config
   (:require
    [clojure.string :as string]
-   [clojure.java.io :as io]))
+   [clojure.java.io :as io]
+   [clojure.walk :as walk]))
 
 (defn optimizations-none?
   "returns true if a build has :optimizations set to :none"

    dir))

(defn normalize-output-dir [opts]
  (update-in opts [:output-dir] normalize-dir))

(defn normalize-output-dirs [builds]
  (mapv normalize-output-dir builds))

(defn prep-builds [builds]
  (-> builds
    map-to-vec-builds
    normalize-output-dirs
    vec))

(defn apply-to-key
  "applies a function to a key, if key is defined."

  "Normalize various configuration input."
  [opts]
  (->> opts
       no-seqs
       (apply-to-key str :ring-handler)
       (apply-to-key str :http-server-root)       
       (apply-to-key str :open-file-command)
       (apply-to-key str :server-logfile)))

