Skip to content

Instantly share code, notes, and snippets.

@kechol
Created February 19, 2012 07:47
Show Gist options
  • Save kechol/1862504 to your computer and use it in GitHub Desktop.
Save kechol/1862504 to your computer and use it in GitHub Desktop.
setup script for my dotfiles
#!/bin/bash
#packages
sudo apt-get -y update
sudo apt-get install -y zsh tmux vim git-core
#zsh
sudo chsh -s /bin/zsh
#symlinks
PWD=`pwd`
PREFIX='.'
DOTFILES=`ls`
IGNOREFILES=( .. bak setup.sh README.md .git )
for DOTFILE in ${DOTFILES[@]}
do
for IGNOREFILE in ${IGNOREFILES[@]}
do
if [ ${DOTFILE} == ${IGNOREFILE} ]
then
continue 2
fi
done
SYMLINK="${HOME}/${PREFIX}${DOTFILE}"
BACKUPTIME=`date +%s`
BACKUPDIR="${PWD}/bak/${BACKUPTIME}"
if [ ! -d ${BACKUPDIR} ]
then
mkdir -p ${BACKUPDIR}
fi
if [ -f ${SYMLINK} ]
then
mv -f ${SYMLINK} ${BACKUPDIR}
fi
echo "${PWD}/${DOTFILE} => ${SYMLINK}"
ln -fs ${PWD}/${DOTFILE} ${SYMLINK}
done
#git
git config --global user.name "YOUR NAME"
git config --global user.email [email protected]
git submodule init
git submodule update
#vim
vim +BundleInstall +q +q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment