Smarter install script
This commit is contained in:
parent
4f5c6cd8d5
commit
0a2e84409e
25
install.sh
25
install.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue