From 934a279a327ae04acfee49557fc03e230d8afa08 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Sat, 23 Jun 2018 10:10:33 -0700 Subject: [PATCH] Add install script --- install.zsh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 install.zsh diff --git a/install.zsh b/install.zsh new file mode 100755 index 0000000..d09341b --- /dev/null +++ b/install.zsh @@ -0,0 +1,31 @@ +#!/usr/bin/env zsh + +set -e + +link="ln -sr" +rm="rm -rf" + +function uninstall { + eval $rm "$HOME/.zshrc" + eval $rm "$HOME/.emacs.d" + eval $rm "$HOME/.tmux.conf" +} + +function install { + eval $link ".emacs.d" "$HOME/.emacs.d" + eval $link ".zshrc" "$HOME/.zshrc" + eval $link ".tmux.conf" "$HOME/.tmux.conf" +} + +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