]>
Commit | Line | Data |
---|---|---|
f1d839f5 JN |
1 | # Babashka Scripts |
2 | ||
3 | Miscellaneous [babashka](https://babashka.org "babashka website") scripts I wrote for my own personal use. | |
4 | ||
5 | ## Requirements | |
6 | ||
7 | babashka (>= 0.2.9) | |
8 | ||
9 | ## Usage | |
10 | ||
11 | Clone this repository. | |
12 | ||
13 | ``` sh | |
14 | cd ~/dev | |
15 | git clone https://njoseph.me/gitweb/babashka-scripts.git | |
16 | ``` | |
17 | ||
18 | Add the following lines to your shell configuration file. | |
19 | ||
20 | ``` sh | |
00a96276 JN |
21 | export BABASHKA_PRELOADS='(run! load-file (map #(str (System/getProperty "user.home") "/dev/babashka-scripts/" %) ["lib.clj" "utils.clj"]))' |
22 | export BABASHKA_PRELOADS=$BABASHKA_PRELOADS" (require '[utils :refer :all])" | |
f1d839f5 JN |
23 | export PATH=$PATH:$HOME/dev/babashka-scripts |
24 | ``` | |
25 | ||
f2db2d8f | 26 | Some useful aliases and functions. |
00a96276 JN |
27 | |
28 | ``` sh | |
29 | alias gup="bb -e '(git-pull-rebase-branch)'" | |
f2db2d8f JN |
30 | alias bbr="rlwrap bb --repl" |
31 | ||
32 | function bb-wrap { | |
33 | expr="($1 \"$2\")" | |
34 | bb -e $expr | |
35 | } | |
36 | ||
37 | alias install-deb="bb-wrap install-deb" | |
38 | alias install-deb-gh="bb-wrap install-deb-from-GitHub" | |
00a96276 JN |
39 | ``` |
40 | ||
f1d839f5 JN |
41 | ## Organization |
42 | ||
00a96276 JN |
43 | `lib.clj` contains functions that the other scripts might use. It must be loaded |
44 | first. | |
45 | ||
46 | `utils.clj` contains standalone utilities that can be executed directly. These are | |
47 | convenient to use through shell aliases. | |
48 | ||
49 | The remaining Clojure files are executable scripts. |