diff --git a/install.sh b/install.sh index a9bf588..85583ee 100755 --- a/install.sh +++ b/install.sh @@ -1 +1,26 @@ #!/bin/bash +# Backup existing configs +if [ -e "$HOME/.tmux.conf" ]; then + printf "Found existing .tmux.conf in your \$HOME directory. Will create a backup at $HOME/.tmux.conf.bak\n" +fi + +cp -f "$HOME/.tmux.conf" "$HOME/.tmux.conf.bak" 2>/dev/null || true + +if [ -e "$HOME/.zshrc" ]; then + printf "Found existing .zshrc in your \$HOME directory. Will create a backup at $HOME/.zshrc.bak\n" +fi + +cp -f "$HOME/.zshrc" "$HOME/.zshrc.bak" 2>/dev/null || true + +if [ -e "$HOME/.vimrc" ]; then + printf "Found existing .vimrc in your \$HOME directory. Will create a backup at $HOME/.vimrc.bak\n" +fi + +cp -f "$HOME/.vimrc" "$HOME/.vimrc.bak" 2>/dev/null || true + +# Create symlinks +ln -sf .dots/tmux/local.conf "$HOME"/.tmux.conf +ln -sf .dots/zsh/zshrc "$HOME"/.zshrc +ln -sf .dots/vim/vimrc "$HOME"/.vimrc + +printf "OK: Completed\n"