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"]])))))
19 "Run a sequence of shell commands on a sequence of arguments.
23 1. Play and delete each video from a folder
24 ls | bb -i '(run-seq ["mpv" "rm"] *input*)'
27 (doseq [argument arguments
29 (println (run-cmd [command argument]))))