Created
February 19, 2012 07:47
-
-
Save kechol/1862504 to your computer and use it in GitHub Desktop.
setup script for my dotfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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