Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 454 Bytes
#!/bin/sh
set -ex
for X in git
do
if ! dpkg --status ${X} 2>&1 >/dev/null
then
sudo apt-get install --yes ${X}
fi
done
BASE_DIR=~/git/projects
TARGET_DIR="${BASE_DIR}/dotfiles"
mkdir -p "${BASE_DIR}"
if [ -d "${TARGET_DIR}" ]
then
cd "${TARGET_DIR}"
git fetch
git reset --hard origin/master
else
cd "${BASE_DIR}"
for X in git https
do
git clone ${X}://github.com/lamby/dotfiles.git && break
done
cd "${TARGET_DIR}"
fi
exec ./install