2 (:require [lib :refer [run-cmd]]
3 [clojure.string :as str]))
5 (defn git-pull-rebase-branch
6 "Do git pull and rebase branch with master"
8 (let [current-branch (str/trim (run-cmd ["git" "branch" "--show-current"]))]
9 (print (run-cmd ["git" "pull" "--rebase"]))
10 (when (not (contains? #{"master" "main"} current-branch))
13 '[["git" "checkout" "master"]
14 ["git" "pull" "--rebase"]
15 ["git" "checkout" "-"]
16 ["git" "rebase" "master"]])))))