(filter #(has-git-repo %)
(filter #(.isDirectory %) (.listFiles (io/file root)))))
-(defn- git-pull [dir] (p/process ["git" "-C" dir "pull" "--rebase"]))
+(defn- git-pull
+ "Do a git pull with rebase."
+ [dir]
+ (p/process ["git" "-C" dir "pull" "--rebase"]))
(defn git-pull-all
- "Runs `git-pull` on all the git repositories in a directory"
+ "Runs `git-pull` on all the git repositories in a directory."
[root]
(let [dirs (list-dirs root)
pulls (->> root
(defn git-pull-rebase-branch
- "Do git pull and rebase branch with master"
+ "Do git pull and rebase branch with master."
[dir]
- (run-cmd ["git" "pull" "--rebase"])
+ (git-pull dir)
(let [current-branch (str/trim (run-cmd ["git" "branch" "--show-current"]))]
(when (not (contains? #{"master" "main"} current-branch))
(run! print