Smarter install script

This commit is contained in:
Henrik Lissner 2014-07-30 00:49:10 -04:00
parent 4f5c6cd8d5
commit 0a2e84409e

View file

@ -1,20 +1,11 @@
#!/bin/sh
function do_link {
if [ ! -h "$HOME/.$1" ]; then
echo "ln -sf '$HOME/.dotfiles/$1' '$HOME/.$1'"
ln -sf "$HOME/.dotfiles/$1" "$HOME/.$1"
fi
}
#!/bin/zsh
# In case this file was run via curl
[ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles
do_link zsh
do_link zshrc
do_link zshenv
do_link tmux.conf
do_link gitignore
do_link gitconfig
do_link bashrc
do_link ctags
do_link rake
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(README.md|Gemfile|install.sh)(.N); do
filep="${ZDOTDIR:-$HOME}/.${rcfile:t}"
[ -h $filep ] || ln -s "$rcfile" $filep
done