|
5 | 5 | [cemerick.pomegranate.aether :as aether]
|
6 | 6 | [boot.util :as util]
|
7 | 7 | [boot.pod :as pod]
|
| 8 | + [boot.from.io.aviso.ansi :as ansi] |
8 | 9 | [boot.kahnsort :as ksort])
|
9 | 10 | (:import
|
10 | 11 | [java.io File]
|
|
129 | 130 | [tree & [prefixes]]
|
130 | 131 | (loop [[[coord branch] & more] (seq tree)]
|
131 | 132 | (when coord
|
132 |
| - (let [pfx (cond (not prefixes) "" (seq more) "├── " :else "└── ")] |
133 |
| - (println (str (apply str prefixes) pfx coord))) |
| 133 | + (let [pfx (cond (not prefixes) "" (seq more) "├── " :else "└── ") |
| 134 | + pfx (ansi/blue (str (apply str prefixes) pfx))] |
| 135 | + (println (str pfx (util/pr-color-str coord)))) |
134 | 136 | (when branch
|
135 | 137 | (let [pfx (cond (not prefixes) "" (seq more) "│ " :else " ")]
|
136 | 138 | (print-tree branch (concat prefixes (list pfx)))))
|
|
172 | 174 |
|
173 | 175 | (def ^:private wagon-files (atom #{}))
|
174 | 176 |
|
| 177 | +(defn load-wagon-mappings |
| 178 | + [& [mapping]] |
| 179 | + (locking wagon-files |
| 180 | + (->> (pod/resources "leiningen/wagons.clj") |
| 181 | + (remove (partial contains? @wagon-files)) |
| 182 | + (map #(do (swap! wagon-files conj %) |
| 183 | + (->> % io/input-stream slurp read-string))) |
| 184 | + (reduce into {}) |
| 185 | + (mapv (fn [[k v]] (aether/register-wagon-factory! k (eval v)))))) |
| 186 | + (doseq [[scheme factory] mapping] |
| 187 | + (aether/register-wagon-factory! scheme (eval factory)))) |
| 188 | + |
175 | 189 | (defn add-wagon
|
176 | 190 | [env coord & [mapping]]
|
177 | 191 | (pod/add-dependencies (assoc env :dependencies [coord]))
|
178 |
| - (let [m (or mapping (locking wagon-files |
179 |
| - (->> (pod/resources "leiningen/wagons.clj") |
180 |
| - (remove (partial contains? @wagon-files)) |
181 |
| - (map #(do (swap! wagon-files conj %) |
182 |
| - (->> % io/input-stream slurp read-string))) |
183 |
| - (reduce into {}))))] |
184 |
| - (doseq [[scheme factory] m] |
185 |
| - (aether/register-wagon-factory! scheme (eval factory))))) |
| 192 | + (load-wagon-mappings mapping)) |
0 commit comments