Sun, 09 Jan 2022 15:17:13 -0500
keep shell stuff in one place, distinguish by ext
964 | 1 | #!/bin/bash |
2 | set -euo pipefail | |
245 | 3 | |
967 | 4 | warn() { echo "$*" >&2; } |
5 | die() { warn "$*"; exit 1; } | |
245 | 6 | |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
7 | clone_or_pull() { |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
8 | if ! [ -d $2 ]; then |
966
e1132c1cce12
use clone --single-branch
Meredith Howard <mhoward@roomag.org>
parents:
965
diff
changeset
|
9 | git clone --single-branch --depth 1 "$1" $2 |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
10 | else |
850 | 11 | echo "$2:" |
966
e1132c1cce12
use clone --single-branch
Meredith Howard <mhoward@roomag.org>
parents:
965
diff
changeset
|
12 | git -C "$2" pull |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
13 | fi |
245 | 14 | } |
15 | ||
967 | 16 | [ -f .zshrc ] || |
17 | die "Refusing to run without a .zshrc nearby" | |
18 | ||
19 | git --version >/dev/null || | |
20 | die "Please install git!" | |
21 | ||
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
22 | clone_or_pull 'https://github.com/tarjoilija/zgen.git' .zgen |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
23 | |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
24 | zsh -i -c 'zgen update' || : |
245 | 25 | |
965
f1e5d30543ba
forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents:
964
diff
changeset
|
26 | clone_or_pull 'https://github.com/asdf-vm/asdf' .asdf |
f1e5d30543ba
forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents:
964
diff
changeset
|
27 | source .asdf/asdf.sh |
245 | 28 | |
965
f1e5d30543ba
forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents:
964
diff
changeset
|
29 | asdf plugin add perl || : |
f1e5d30543ba
forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents:
964
diff
changeset
|
30 | asdf plugin update --all |
756 | 31 | |
965
f1e5d30543ba
forget the minimal setup mode
Meredith Howard <mhoward@roomag.org>
parents:
964
diff
changeset
|
32 | bin/setup-man || : |
381
b09db2db7f84
use ruby and nodejs plugins for asdf
Meredith Howard <mhoward@roomag.org>
parents:
328
diff
changeset
|
33 | |
459
efa21f0b1dca
Remove rbenv & ndenv transition stuff
Meredith Howard <mhoward@roomag.org>
parents:
383
diff
changeset
|
34 | # Get rid of older stuff |
964 | 35 | for OLD in .plenv .rbenv .ndenv; do |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
36 | if [ -e $OLD ]; then |
967 | 37 | warn "Pruning $OLD" |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
38 | rm -rf $OLD |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
39 | fi |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
40 | done |