X-Git-Url: https://njoseph.me/gitweb/babashka-scripts.git/blobdiff_plain/746d64040956017457d38f0bf59649e96d0ab449..ec37ad05d576d79b3dc2d05b2bcae632a93e8c35:/scripts/utils.clj diff --git a/scripts/utils.clj b/scripts/utils.clj new file mode 100644 index 0000000..8ea7664 --- /dev/null +++ b/scripts/utils.clj @@ -0,0 +1,15 @@ +(ns utils + (:require [lib :refer [run-cmd]])) + +(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]))))