diff --git a/install.sh b/install.sh index bd2be092..5d758a2e 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,9 @@ #!/bin/bash +_clone() { [[ -d "$2" ]] || git clone --recursve "$1" "$2"; } + # In case this file was run via curl -[ ! -d ~/.dotfiles ] && git clone --recursive https://github.com/hlissner/dotfiles ~/.dotfiles +_clone https://github.com/hlissner/dotfiles ~/.dotfiles shopt -s extglob for rcfile in "${HOME}/.dotfiles/!(.*|bin|scripts|*.md|install.sh)" @@ -9,6 +11,17 @@ do filep="$HOME/."$(basename "$rcfile") [ "$1" == "--force" ] && rm -f "$filep" - [ -e "$filep" ] && continue - ln -vsF "$rcfile" $filep + [ -e "$filep" ] || ln -vsF "$rcfile" $filep done + +# Install fzf and fasd +case $OSTYPE in + darwin*) + brew install fzf fasd + ;; + linux*) + _clone https://github.com/junegunn/fzf ~/.fzf + _clone https://github.com/clvv/fasd ~/fasd && \ + cd ~/fasd && make install && rm -rf ~/fasd + ;; +esac