Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 34 lines (30 sloc) 813 Bytes
#!/bin/bash
set -e -u -f -o pipefail
if [[ -z "$(type -a vim)" ]]; then
echo "Missing vim :(" >&2
echo "apt-get install vim-nox" >&2
exit 1
fi
DESTDIR="src/dotfiles"
readonly DESTDIR
cd "${HOME}"
if [ ! -d "${DESTDIR}" ]; then
mkdir -p "$(dirname "${DESTDIR}")"
git clone https://github.com/tobinjt/dotfiles.git "${DESTDIR}"
fi
cd "${DESTDIR}"
# Make .ssh inaccessible.
chmod 700 .ssh
git pull
git submodule init
git submodule update
# Remove .bashrc that linkdirs will not overwrite.
rm -f "${HOME}/.bashrc"
PATH="${PATH}:${HOME}/bin"
export PATH
dotfiles
if [ "${USER}" == "johntobin" ]; then
sed -i -e 's!https://github.com/!git@github.com:!' .git/config
# I need to do this anyway, so might as well do it now.
sed -i -e 's!https://github.com/!git@github.com:!' "${HOME}/bin/.git/config"
fi