public
Description: /bin/zsh and loving it
Homepage: http://stephencelis.com/archive/2008/10/ez-does-it-gemdoc
Clone URL: git://github.com/stephencelis/dotfiles.git
dotfiles / install.sh
100755 21 lines (18 sloc) 0.608 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
 
path=$(pwd -P)
 
for each in $(echo * | sort | awk '{gsub(/README|install.sh/,"");print}'); do
if [[ $each != 'install.sh' ]] && [[ $each != 'README' ]]; then
echo Installing .$each into $HOME...
    if [[ -f $HOME/.$each ]] || [[ -d $HOME/.$each ]]; then
      [[ $stdin != 'a' ]] && printf "Exists. Overwrite? [yNaq] " && read stdin
      [[ $stdin == 'q' ]] && exit
if [[ $stdin == 'a' ]] || [[ $stdin == 'y' ]]; then
echo 'Overwriting...'
        rm $HOME/.$each
        ln -s $path/$each $HOME/.$each
      fi
else
ln -s $path/$each $HOME/.$each
    fi
fi
done