|
114 | 114 | (defn- cli-deps-tree [lib]
|
115 | 115 | (deps-tree lib "clojure -Stree"))
|
116 | 116 |
|
117 |
| -(defn- patch-rewrite-cljc-sources [home-dir] |
118 |
| - (status/line :detail "=> Patching sources") |
119 |
| - (doall (map (fn [f] |
120 |
| - (let [f (fs/file f) |
121 |
| - content (slurp f) |
122 |
| - new-content (string/replace content #"(\[rewrite-)cljc(\.\w+\s+:as\s+\w+\])" |
123 |
| - "$1clj$2")] |
124 |
| - (when (not= content new-content) |
125 |
| - (status/line :detail "- patching source: %s" f) |
126 |
| - (spit f new-content)))) |
127 |
| - (fs/glob home-dir "**/*.{clj,cljc,cljs}")))) |
128 |
| - |
129 | 117 | (defn- patch-deps [{:keys [filename] :as opts}]
|
130 | 118 | (status/line :detail "=> Patching deps in: %s" filename)
|
131 | 119 | (if (string/ends-with? filename "deps.edn")
|
|
159 | 147 | (let [{:keys [exit]} (shcmd {:dir home-dir :continue true}
|
160 | 148 | "git --no-pager diff --exit-code")]
|
161 | 149 | (when (zero? exit)
|
| 150 | + |
162 | 151 | (status/die 1 "found no changes, patch must have failed" ))))
|
163 | 152 |
|
164 | 153 | ;;
|
|
171 | 160 | :additions [['org.clojure/tools.reader "1.3.6"]
|
172 | 161 | ['rewrite-clj rewrite-clj-version]]}))
|
173 | 162 |
|
174 |
| -;; |
175 |
| -;; carve |
176 |
| -;; |
177 |
| -(defn carve-patch [{:keys [home-dir rewrite-clj-version]}] |
178 |
| - (patch-deps {:filename (str (fs/file home-dir "deps.edn")) |
179 |
| - :removals #{'borkdude/rewrite-cljc} |
180 |
| - :additions [['rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}]]}) |
181 |
| - (patch-rewrite-cljc-sources home-dir)) |
182 |
| - |
183 | 163 | ;;
|
184 | 164 | ;; clojure-lsp
|
185 | 165 | ;;
|
|
196 | 176 | (patch-deps {:filename (str (fs/file home-dir "deps.edn"))
|
197 | 177 | :removals #{'rewrite-clj/rewrite-clj}
|
198 | 178 | :additions [['rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}]]})
|
199 |
| - (patch-rewrite-cljc-sources home-dir) |
200 | 179 | (status/line :detail "=> depot uses but does not require rewrite-clj.node, need to adjust for rewrite-clj v1")
|
201 | 180 | (replace-in-file (str (fs/file home-dir "src/depot/zip.clj"))
|
202 | 181 | "[rewrite-clj.zip :as rzip]"
|
|
285 | 264 | :show-deps-fn cli-deps-tree
|
286 | 265 | :test-cmds ["clojure -M:dev:test"]}
|
287 | 266 | {:name "carve"
|
288 |
| - :version "0.0.2" |
| 267 | + :version "0.1.0" |
289 | 268 | :platforms [:clj]
|
290 | 269 | :github-release {:repo "borkdude/carve"
|
291 | 270 | :version-prefix "v"}
|
292 |
| - :patch-fn carve-patch |
| 271 | + :patch-fn deps-edn-v1-patch |
293 | 272 | :show-deps-fn cli-deps-tree
|
294 | 273 | :test-cmds ["clojure -M:test"]}
|
295 | 274 | {:name "cljfmt"
|
|
0 commit comments