bin/homedir-setup

Sun, 01 Jan 2017 22:57:59 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 01 Jan 2017 22:57:59 -0500
changeset 465
a771fe75a85c
parent 461
d5abcf2b7365
child 482
2c7cb331d2dc
permissions
-rwxr-xr-x

never used this

#!/bin/sh
set -eu

if [ ! -f .zshrc ]; then
  echo "Refusing to run without a .zshrc nearby" >&2
  exit 1
fi

if ! git --version >/dev/null; then
  echo "Please install git!" >&2
  exit 1
fi

pull() {
  echo "$1:"
  git -C "$1" pull --no-tags
}

if ! [ -d .zgen ]; then
  git clone 'https://github.com/tarjoilija/zgen.git' .zgen
else
  pull .zgen
fi

if ! [ -d .plenv ]; then
  git clone 'https://github.com/tokuhirom/plenv.git' .plenv
  git clone 'https://github.com/tokuhirom/Perl-Build.git' .plenv/plugins/perl-build/
else
  pull .plenv
  pull .plenv/plugins/perl-build
fi

if ! [ -d .asdf ]; then
  git clone 'https://github.com/asdf-vm/asdf' .asdf
else
  pull .asdf
fi

for LANG in ruby nodejs erlang elixir; do
  if ! [ -d .asdf/plugins/$LANG ]; then
    git clone "https://github.com/asdf-vm/asdf-$LANG" .asdf/plugins/$LANG
  else
    pull .asdf/plugins/$LANG
  fi
done

# Get rid of older stuff
if [ -d .rbenv ]; then
  echo 'rbenv is still installed' >&2
fi

if [ -d .ndenv ]; then
  echo 'ndenv is still installed' >&2
fi

mercurial