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