bin/homedir-setup

changeset 534
6a8fc81c470c
parent 486
608ad4499439
child 756
8bc91181db9d
equal deleted inserted replaced
533:55a8ac65cd18 534:6a8fc81c470c
1 #!/bin/sh 1 #!/bin/sh
2 set -eu 2 set -eu
3
4 minimal=0
5
6 case ${1:-} in -m) minimal=1;;
7 esac
3 8
4 if [ ! -f .zshrc ]; then 9 if [ ! -f .zshrc ]; then
5 echo "Refusing to run without a .zshrc nearby" >&2 10 echo "Refusing to run without a .zshrc nearby" >&2
6 exit 1 11 exit 1
7 fi 12 fi
18 23
19 if ! [ -d .zgen ]; then 24 if ! [ -d .zgen ]; then
20 git clone --depth 1 'https://github.com/tarjoilija/zgen.git' .zgen 25 git clone --depth 1 'https://github.com/tarjoilija/zgen.git' .zgen
21 else 26 else
22 pull .zgen 27 pull .zgen
23 zsh -i -c 'zgen update' 28 zsh -i -c 'zgen update' || true
24 fi 29 fi
25 30
26 if ! [ -d .plenv ]; then 31 if [ "$minimal" -ne 1 ]; then
27 git clone --depth 1 'https://github.com/tokuhirom/plenv.git' .plenv 32 if ! [ -d .plenv ]; then
28 git clone --depth 1 'https://github.com/tokuhirom/Perl-Build.git' .plenv/plugins/perl-build/ 33 git clone --depth 1 'https://github.com/tokuhirom/plenv.git' .plenv
29 else 34 git clone --depth 1 'https://github.com/tokuhirom/Perl-Build.git' .plenv/plugins/perl-build/
30 pull .plenv 35 else
31 pull .plenv/plugins/perl-build 36 pull .plenv
37 pull .plenv/plugins/perl-build
38 fi
39
40 if ! [ -d .asdf ]; then
41 git clone --depth 1 'https://github.com/asdf-vm/asdf' .asdf
42 else
43 pull .asdf
44 fi
45
46 for LANG in ruby nodejs erlang elixir; do
47 if ! [ -d .asdf/plugins/$LANG ]; then
48 git clone --depth 1 "https://github.com/asdf-vm/asdf-$LANG" .asdf/plugins/$LANG
49 else
50 pull .asdf/plugins/$LANG
51 fi
52 done
32 fi 53 fi
33
34 if ! [ -d .asdf ]; then
35 git clone --depth 1 'https://github.com/asdf-vm/asdf' .asdf
36 else
37 pull .asdf
38 fi
39
40 for LANG in ruby nodejs erlang elixir; do
41 if ! [ -d .asdf/plugins/$LANG ]; then
42 git clone --depth 1 "https://github.com/asdf-vm/asdf-$LANG" .asdf/plugins/$LANG
43 else
44 pull .asdf/plugins/$LANG
45 fi
46 done
47 54
48 # Get rid of older stuff 55 # Get rid of older stuff
49 if [ -d .rbenv ]; then 56 if [ -d .rbenv ]; then
50 echo 'rbenv is still installed' >&2 57 echo 'rbenv is still installed' >&2
51 fi 58 fi

mercurial