Created
January 12, 2020 21:56
-
-
Save borkdude/9577ee77f02f62217a8fd709e3e7f9f3 to your computer and use it in GitHub Desktop.
Managing babashka deps manually with git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[babashka.classpath :refer [add-classpath]] | |
'[clojure.java.shell :refer [sh with-sh-dir]] | |
'[clojure.java.io :as io]) | |
(def script-dir (.getParentFile (io/file *file*))) | |
(def libs-dir (.getPath (io/file script-dir "lib"))) | |
(defn add-github-lib [username libname sha] | |
(let [lib-dir (io/file libs-dir libname)] | |
(when-not (.exists lib-dir) | |
(sh "mkdir" "-p" libs-dir) | |
(with-sh-dir libs-dir (sh "git" "clone" (str "https://github.com/" username "/" libname) )) | |
(with-sh-dir lib-dir (sh "git" "reset" "--hard" sha))) | |
(add-classpath (.getPath (io/file lib-dir "src"))))) | |
(add-github-lib "borkdude" "spartan.spec" "ff7317d67ec15f188afb856d37090e5c9509374e") | |
(add-github-lib "borkdude" "medley" "91adfb5da33f8d23f75f0894da1defe567a625c0") | |
(require '[spartan.spec :as s]) | |
(s/explain (s/cat :i int? :j string?) [10 :foo]) | |
(require '[medley.core :refer [map-vals]]) | |
(prn (map-vals inc {:a 1 :b 1})) |
Author
borkdude
commented
Jan 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment