Title / Description
Code (defn sync-lib-deps [& {:as opts}] (->> (for [lib (if (seq (:libs opts)) (set/intersection (set enabled-libs) (set (:libs opts))) enabled-libs) path (fs/glob (str "libs/" lib) "deps.edn") :let [f (io/file (str path))]] (do (when-not (.exists (io/file f)) (println "File does not exist" f) (System/exit 1)) (let [original (slurp f) updated (str (replace-dependencies original dependencies))] (when (not= original updated) (spit f updated)) (str path)))) (remove nil?) doall)) (defn -main [& _] (sync-lib-deps)) (when (= *file* (System/getProperty "babashka.file")) (apply -main *command-line-args*)) (comment (def test-code "{:paths [\"src\"] :deps {integrant/integrant {:mvn/version \"0.7.0\"} com.xtdb/xtdb-core {:mvn/version \"1.20.0\"}}}") (replace-dependencies test-code dependencies))
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code