fixes

Wed, 31 Aug 2016 16:35:04 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 31 Aug 2016 16:35:04 -0400
changeset 382
09a6309e4856
parent 381
b09db2db7f84
child 383
c14c440cda0f

fixes

bin/homedir-setup file | annotate | diff | comparison | revisions
--- a/bin/homedir-setup
+++ b/bin/homedir-setup
@@ -44,21 +44,17 @@ for LANG in ruby nodejs erlang elixir; d
   fi
 done
 
-set +eu
-. .asdf/asdf.sh
-set -eu
-
 # Transition older stuff to asdf
 if [ -d .rbenv ]; then
   echo 'Removing rbenv and moving ruby installs'
 
-  mkdir -p .asdf/installs
-  mv .rbenv/versions .asdf/installs/ruby
-  pushd $!
-  for ver in *; do
-    asdf reshim ruby $ver
-  done
-  popd
+  if [ -d .rbenv/versions ]; then
+    mkdir -p .asdf/installs
+    mv .rbenv/versions .asdf/installs/ruby
+    for ver in .asdf/installs/ruby/*; do
+      bash -c "asdf reshim ruby $(basename $ver)"
+    done
+  fi
 
   if [ -f .rbenv/version ]; then
     echo "ruby $(cat .rbenv/version)" >> .tool-versions
@@ -70,13 +66,13 @@ fi
 if [ -d .ndenv ]; then
   echo 'Removing ndenv and moving node installs'
 
-  mkdir -p .asdf/installs
-  mv .ndenv/versions .asdf/installs/nodejs
-  pushd $!
-  for ver in *; do
-    asdf reshim nodejs $ver
-  done
-  popd
+  if [ -d .ndenv/versions ]; then
+    mkdir -p .asdf/installs
+    mv .ndenv/versions .asdf/installs/nodejs
+    for ver in .asdf/installs/nodejs/*; do
+      bash -c "asdf reshim nodejs $(basename $ver)"
+    done
+  fi
 
   if [ -f .ndenv/version ]; then
     echo "nodejs $(cat .ndenv/version)" >> .tool-versions

mercurial