]> njoseph.me Git - babashka-scripts.git/blobdiff - utils.clj
git: minor changes
[babashka-scripts.git] / utils.clj
diff --git a/utils.clj b/utils.clj
deleted file mode 100644 (file)
index c3cdf5a..0000000
--- a/utils.clj
+++ /dev/null
@@ -1,29 +0,0 @@
-(ns utils
-  (:require [lib :refer [run-cmd]]
-            [clojure.string :as str]))
-
-(defn git-pull-rebase-branch
-  "Do git pull and rebase branch with master"
-  []
-  (let [current-branch (str/trim (run-cmd ["git" "branch" "--show-current"]))]
-    (print (run-cmd ["git" "pull" "--rebase"]))
-    (when (not (contains? #{"master" "main"} current-branch))
-     (run! print
-      (map run-cmd
-       '[["git" "checkout" "master"]
-         ["git" "pull" "--rebase"]
-         ["git" "checkout" "-"]
-         ["git" "rebase" "master"]])))))
-
-(defn run-seq
-  "Run a sequence of shell commands on a sequence of arguments.
-
-  Examples:
-
-  1. Play and delete each video from a folder
-     ls | bb -i '(run-seq ["mpv" "rm"] *input*)'
-  "
-  [commands arguments]
-  (doseq [argument arguments
-          command commands]
-    (println (run-cmd [command argument]))))