]> arthur.barton.de Git - ax-zsh.git/blob - install.sh
Initial commit
[ax-zsh.git] / install.sh
1 #!/bin/sh
2 #
3 # AX-ZSH: Alex' Modular ZSH Configuration
4 # Copyright (c) 2015 Alexander Barton <alex@barton.de>
5 #
6
7 safe_rm() {
8         if [ -f "$1" -a ! -L "$1" ]; then
9                 rm -f "$1.bak" || exit 1
10                 mv -v "$1" "$1.bak" || exit 1
11         fi
12         rm -f "$1" || exit 1
13 }
14
15 for f in ~/.zlogin ~/.zlogout ~/.zprofile ~/.zshrc; do
16         safe_rm "$f" || exit 1
17         ln -sv "$PWD/ax.zsh" "$f" || exit 1
18 done
19
20 safe_rm ~/.axzsh || exit 1
21 ln -sv "$PWD" ~/.axzsh || exit 1