1 #!/bin/bash |
1 #!/bin/bash |
2 set -euo pipefail |
2 set -euo pipefail |
3 |
3 |
4 warn() { echo "$*" >&2; } |
4 source .lib/sh/util.sh |
5 die() { warn "$*"; exit 1; } |
|
6 |
|
7 clone_or_pull() { |
|
8 if ! [ -d $2 ]; then |
|
9 git clone --single-branch --depth 1 "$1" $2 |
|
10 else |
|
11 echo "$2:" |
|
12 git -C "$2" pull |
|
13 fi |
|
14 } |
|
15 |
5 |
16 [ -f .zshrc ] || |
6 [ -f .zshrc ] || |
17 die "Refusing to run without a .zshrc nearby" |
7 die "Refusing to run without a .zshrc nearby" |
18 |
8 |
19 git --version >/dev/null || |
9 git --version >/dev/null || |