3 ; Runs `git pull` on all the git repositories in a directory
5 (require '[babashka.process :as p] '[clojure.java.io :as io])
9 (defn list-dirs [root] (filter #(.isDirectory %) (.listFiles (io/file root))))
11 (defn git-pull [dir] (p/process ["git" "-C" dir "pull" "--rebase"]))
13 (when (= *file* (System/getProperty "babashka.file"))
14 (let [root (get (into [] *command-line-args*) 0 default-root)
25 ;; Print corresponding directory name when pulling
26 ;; Skip printing already up to date repos
27 (doseq [[dir out] (filter #(not (.contains (second %) "is up to date."))
28 (map vector dirs outputs))]
29 (println (str dir "\n" out)))))