Fri, 06 Aug 2021 11:34:28 -0500
add fork-point alias
245 | 1 | #!/bin/sh |
2 | set -eu | |
3 | ||
534
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
4 | minimal=0 |
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
5 | |
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
6 | case ${1:-} in -m) minimal=1;; |
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
7 | esac |
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
8 | |
285 | 9 | if [ ! -f .zshrc ]; then |
10 | echo "Refusing to run without a .zshrc nearby" >&2 | |
11 | exit 1 | |
12 | fi | |
13 | ||
245 | 14 | if ! git --version >/dev/null; then |
285 | 15 | echo "Please install git!" >&2 |
245 | 16 | exit 1 |
17 | fi | |
18 | ||
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
19 | clone_or_pull() { |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
20 | if ! [ -d $2 ]; then |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
21 | git clone --depth 1 "$1" $2 |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
22 | else |
850 | 23 | echo "$2:" |
24 | git -C "$2" pull --no-tags | |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
25 | fi |
245 | 26 | } |
27 | ||
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
28 | 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
|
29 | |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
30 | zsh -i -c 'zgen update' || : |
245 | 31 | |
534
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
32 | if [ "$minimal" -ne 1 ]; then |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
33 | clone_or_pull 'https://github.com/tokuhirom/plenv.git' .plenv |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
34 | clone_or_pull 'https://github.com/skaji/perl-install' .plenv/plugins/perl-install |
245 | 35 | |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
36 | clone_or_pull 'https://github.com/asdf-vm/asdf' .asdf |
534
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
37 | |
758
949b2d4df5fd
whoops, LANG confuses things later
Meredith Howard <mhoward@roomag.org>
parents:
756
diff
changeset
|
38 | for PLUGIN in ruby nodejs erlang elixir; do |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
39 | clone_or_pull "https://github.com/asdf-vm/asdf-$PLUGIN" .asdf/plugins/$PLUGIN |
534
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
40 | done |
756 | 41 | |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
42 | bin/setup-man || : |
534
6a8fc81c470c
Add -m minimal option to skip extras
Meredith Howard <mhoward@roomag.org>
parents:
486
diff
changeset
|
43 | fi |
381
b09db2db7f84
use ruby and nodejs plugins for asdf
Meredith Howard <mhoward@roomag.org>
parents:
328
diff
changeset
|
44 | |
459
efa21f0b1dca
Remove rbenv & ndenv transition stuff
Meredith Howard <mhoward@roomag.org>
parents:
383
diff
changeset
|
45 | # Get rid of older stuff |
849
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
46 | for OLD in .plenv/plugins/perl-build .rbenv .ndenv; do |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
47 | if [ -e $OLD ]; then |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
48 | echo "Pruning $OLD" >&2 |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
49 | rm -rf $OLD |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
50 | fi |
9a6cb845e239
Switch to perl-install and simplify clone or pull
Meredith Howard <mhoward@roomag.org>
parents:
760
diff
changeset
|
51 | done |