bin/homedir-setup

changeset 849
9a6cb845e239
parent 760
d439bf421f1b
child 850
5ebdbddeafde
equal deleted inserted replaced
848:c39d655f455c 849:9a6cb845e239
14 if ! git --version >/dev/null; then 14 if ! git --version >/dev/null; then
15 echo "Please install git!" >&2 15 echo "Please install git!" >&2
16 exit 1 16 exit 1
17 fi 17 fi
18 18
19 pull() { 19 clone_or_pull() {
20 echo "$1:" 20 if ! [ -d $2 ]; then
21 git -C "$1" pull --no-tags 21 git clone --depth 1 "$1" $2
22 else
23 echo "$1:"
24 git -C "$1" pull --no-tags
25 fi
22 } 26 }
23 27
24 if ! [ -d .zgen ]; then 28 clone_or_pull 'https://github.com/tarjoilija/zgen.git' .zgen
25 git clone --depth 1 'https://github.com/tarjoilija/zgen.git' .zgen 29
26 else 30 zsh -i -c 'zgen update' || :
27 pull .zgen
28 zsh -i -c 'zgen update' || true
29 fi
30 31
31 if [ "$minimal" -ne 1 ]; then 32 if [ "$minimal" -ne 1 ]; then
32 if ! [ -d .plenv ]; then 33 clone_or_pull 'https://github.com/tokuhirom/plenv.git' .plenv
33 git clone --depth 1 'https://github.com/tokuhirom/plenv.git' .plenv 34 clone_or_pull 'https://github.com/skaji/perl-install' .plenv/plugins/perl-install
34 git clone --depth 1 'https://github.com/tokuhirom/Perl-Build.git' .plenv/plugins/perl-build/
35 else
36 pull .plenv
37 pull .plenv/plugins/perl-build
38 fi
39 35
40 if ! [ -d .asdf ]; then 36 clone_or_pull 'https://github.com/asdf-vm/asdf' .asdf
41 git clone --depth 1 'https://github.com/asdf-vm/asdf' .asdf
42 else
43 pull .asdf
44 fi
45 37
46 for PLUGIN in ruby nodejs erlang elixir; do 38 for PLUGIN in ruby nodejs erlang elixir; do
47 if ! [ -d .asdf/plugins/$PLUGIN ]; then 39 clone_or_pull "https://github.com/asdf-vm/asdf-$PLUGIN" .asdf/plugins/$PLUGIN
48 git clone --depth 1 "https://github.com/asdf-vm/asdf-$PLUGIN" .asdf/plugins/$PLUGIN
49 else
50 pull .asdf/plugins/$PLUGIN
51 fi
52 done 40 done
53 41
54 bin/setup-man || true 42 bin/setup-man || :
55 fi 43 fi
56 44
57 # Get rid of older stuff 45 # Get rid of older stuff
58 if [ -d .rbenv ]; then 46 for OLD in .plenv/plugins/perl-build .rbenv .ndenv; do
59 echo 'rbenv is still installed' >&2 47 if [ -e $OLD ]; then
60 fi 48 echo "Pruning $OLD" >&2
61 49 rm -rf $OLD
62 if [ -d .ndenv ]; then 50 fi
63 echo 'ndenv is still installed' >&2 51 done
64 fi

mercurial