bin/homedir-setup

changeset 381
b09db2db7f84
parent 328
b3b18ced6949
child 382
09a6309e4856
equal deleted inserted replaced
380:d04b95905553 381:b09db2db7f84
28 else 28 else
29 pull .plenv 29 pull .plenv
30 pull .plenv/plugins/perl-build 30 pull .plenv/plugins/perl-build
31 fi 31 fi
32 32
33 if ! [ -d .rbenv ]; then 33 if ! [ -d .asdf ]; then
34 git clone https://github.com/sstephenson/rbenv.git .rbenv 34 git clone https://github.com/asdf-vm/asdf .asdf
35 git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build/
36 else 35 else
37 pull .rbenv 36 pull .asdf
38 pull .rbenv/plugins/ruby-build
39 fi 37 fi
40 38
41 if ! [ -d .ndenv ]; then 39 for LANG in ruby nodejs erlang elixir; do
42 git clone https://github.com/riywo/ndenv.git .ndenv 40 if ! [ -d .asdf/plugins/$LANG ]; then
43 git clone https://github.com/riywo/node-build.git .ndenv/plugins/node-build 41 git clone https://github.com/asdf-vm/asdf-$LANG .asdf/plugins/$LANG
44 else 42 else
45 pull .ndenv 43 pull .asdf/plugins/$LANG
46 pull .ndenv/plugins/node-build 44 fi
45 done
46
47 set +eu
48 . .asdf/asdf.sh
49 set -eu
50
51 # Transition older stuff to asdf
52 if [ -d .rbenv ]; then
53 echo 'Removing rbenv and moving ruby installs'
54
55 mkdir -p .asdf/installs
56 mv .rbenv/versions .asdf/installs/ruby
57 pushd $!
58 for ver in *; do
59 asdf reshim ruby $ver
60 done
61 popd
62
63 if [ -f .rbenv/version ]; then
64 echo "ruby $(cat .rbenv/version)" >> .tool-versions
65 fi
66
67 rm -rf .rbenv
47 fi 68 fi
48 69
49 if ! [ -d .asdf ]; then 70 if [ -d .ndenv ]; then
50 git clone https://github.com/asdf-vm/asdf .asdf 71 echo 'Removing ndenv and moving node installs'
51 git clone https://github.com/asdf-vm/asdf-erlang .asdf/plugins/erlang 72
52 git clone https://github.com/asdf-vm/asdf-elixir .asdf/plugins/elixir 73 mkdir -p .asdf/installs
53 else 74 mv .ndenv/versions .asdf/installs/nodejs
54 pull .asdf 75 pushd $!
55 pull .asdf/plugins/erlang 76 for ver in *; do
56 pull .asdf/plugins/elixir 77 asdf reshim nodejs $ver
78 done
79 popd
80
81 if [ -f .ndenv/version ]; then
82 echo "nodejs $(cat .ndenv/version)" >> .tool-versions
83 fi
84
85 rm -rf .ndenv
57 fi 86 fi
58

mercurial