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