bootstrap/bootstrap.sh

41 lines
1.0 KiB
Bash
Raw Normal View History

2015-04-27 20:05:38 -04:00
#!/bin/bash
firstRun=0
[ "$1" == "-f" ] && firstRun=1
2015-04-27 20:05:38 -04:00
cd ~
if [ ! -d ".dotfiles" ]
then
git clone http://adamgoldsmith.name/cgit/dotfiles.git .dotfiles
firstRun=1
2015-04-27 20:05:38 -04:00
else
echo "~/.dotfiles already exists, not cloning"
fi
echo "Updating .dotfiles"
2015-06-11 10:10:37 -04:00
cd .dotfiles
if [ $firstRun -eq 1 ]
then
2015-06-11 10:10:37 -04:00
git remote set-url origin http://adamgoldsmith.name/cgit/dotfiles.git
git remote set-url --push origin ssh://adamgoldsmith.name:443/srv/git/dotfiles.git
fi
2015-04-27 20:05:38 -04:00
git pull
git submodule init
git submodule update
echo "Updating .dotfiles/zsh/.zprezto"
cd zsh/.zprezto/
if [ $firstRun -eq 1 ]
then
2015-06-11 10:10:37 -04:00
git remote set-url origin http://adamgoldsmith.name/cgit/prezto.git
git remote set-url --push origin ssh://adamgoldsmith.name:443/srv/git/prezto.git
git remote add upstream https://github.com/sorin-ionescu/prezto.git
fi
2015-04-27 20:05:38 -04:00
git submodule init
git submodule update
echo "Stowing emacs, zsh, and git"
cd ~/.dotfiles/
stow emacs zsh git
echo 'Didn'\''t stow ssh, please stow that manually with "stow ssh" in the .dotfiles directory if you want that'