skel.sh (909B) [raw]
1 #!/bin/sh 2 # skel.sh -- links the "/etc/skel" subset of my dotfiles 3 # intended usage: 4 # $ git clone git://git.alexkarle.com/dotfiles.git 5 # $ ./dotfiles/etc/skel.sh 6 # $ # manually link any other files 7 # 8 # NOTE: .{bash_,}profile is *generated* so that per-site 9 # customizations can be put in. This script checks that the 10 # bits worth version controlling are installed properly 11 set -e 12 DIR="$(dirname "$(dirname "$(readlink -f "$0")")")" 13 14 add() { 15 dot="$1" 16 cmd="$2" 17 printf "%s ... " "$dot" 18 if test ! -e "$HOME/$dot" 19 then 20 echo "$cmd" >> "$HOME/$dot" 21 echo "new" 22 elif grep -q "$cmd" "$HOME/$dot" 23 then 24 echo "exists" 25 else 26 echo "$cmd" >> "$HOME/$dot" 27 echo "added" 28 fi 29 } 30 31 mkdir -p $HOME/.config 32 33 # TODO: create full install.sh 34 "$DIR/bin/lnkdot" .tmux.conf 35 "$DIR/bin/lnkdot" .config/git 36 "$DIR/bin/lnkdot" .exrc 37 add .profile "export PATH=\"$DIR/bin:\$PATH\"" 38 add .profile "export ENV=\"$DIR/.shrc\""