``` sh
bb ebook-to-audiobook the-great-gatsby.epub
```
+
+There are a utility file that makes running the tasks easier. Load it up first.
+You can also add the following line with the absolute path to the file in your "~/.profile" file.
+
+``` sh
+source bb-aliases.sh
+```
+
+*Example:* To pull all the repositories in a directory, run
+
+``` sh
+bbe gpa
+```
--- /dev/null
+#!/usr/bin/env bash
+
+export BABASHKA_PRELOADS='(doseq [fil ["lib.clj" "utils.clj"]] (load-file (str (System/getProperty "user.home") "/dev/babashka-scripts/scripts/" fil)))'
+export BABASHKA_PRELOADS=$BABASHKA_PRELOADS" (require '[utils :refer :all])"
+
+bbe() {
+ bb -e "(run-task-in-cwd \"$1\")"
+}
(ns utils
- (:require [lib :refer [run-cmd]]))
+ (:require [lib :refer [expand-home run-cmd]]
+ [babashka.process :refer [process]]))
(defn run-seq
"Run a sequence of shell commands on a sequence of arguments.
(doseq [argument arguments
command commands]
(println (run-cmd [command argument]))))
+
+(defn run-task-in-cwd
+ "Run a bb task from this repository in the current working directory."
+ [task]
+ (let [current-dir (System/getenv "PWD")
+ babashka-scripts-dir (expand-home "~/dev/babashka-scripts/")]
+ (print (-> (process ["bb" task current-dir] {:dir babashka-scripts-dir})
+ :out
+ slurp))))