From 3879718cea3bdb0750fe7eb1964904be895f7ccb Mon Sep 17 00:00:00 2001 From: ashincoder Date: Tue, 15 Jun 2021 14:35:23 +0530 Subject: [PATCH] changed script to mv nvim to nvim.bak instead of deleting it --- install.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 3e27e53..e1395a9 100755 --- a/install.sh +++ b/install.sh @@ -23,13 +23,21 @@ if [ ! -d ~/.local/share/nvim/site/pack/packer ]; then fi echo "Linking config" -echo "old nvim config will be deleted so watchout! :0" -echo +echo "old nvim config will be changed to nvim.bak if exists! :0" # copying config +if [ -d ~/.config/nvim ]; then + echo "Nvim Directory exists" + echo "Changing nvim to nvim.bak" + mv ~/.config/nvim/ ~/.config/nvim.bak/ + echo "Creating new nvim directory" + mkdir -p ~/.config/nvim +else + echo "Nvim Config doesn't exist so creating one" + mkdir -p ~/.config/nvim/ +fi -rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim -cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim +cp -r init.lua ~/.config/nvim/ && cp -r lua ~/.config/nvim/ # change shell in nvim config read -p "which shell do you use?: " shellname