dotfiles/install.zsh

34 lines
632 B
Bash
Raw Normal View History

2018-06-23 10:10:33 -07:00
#!/usr/bin/env zsh
set -e
2018-06-23 19:45:51 -07:00
link="ln -s"
2018-06-23 10:10:33 -07:00
rm="rm -rf"
function uninstall {
eval $rm "$HOME/.zshrc"
eval $rm "$HOME/.emacs.d"
eval $rm "$HOME/.tmux.conf"
2018-06-23 10:17:02 -07:00
eval $rm "$HOME/.config/nvim"
2018-06-23 10:10:33 -07:00
}
function install {
2018-06-23 19:45:51 -07:00
eval $link "$PWD/.emacs.d" "$HOME/.emacs.d"
eval $link "$PWD/.zshrc" "$HOME/.zshrc"
eval $link "$PWD/.tmux.conf" "$HOME/.tmux.conf"
eval $link "$PWD/.config/nvim" "$HOME/.config/nvim"
2018-06-23 10:10:33 -07:00
}
if [[ "$1" == "uninstall" ]]; then
echo -n "Uninstalling..."
uninstall
echo "Done"
elif [[ "$1" == "install" || "$1" == "" ]]; then
echo -n "Installing..."
uninstall
install
echo "Done"
else
echo "Unknown command \`$1\`"
fi