From f11fb1374fca27551b4f5397ea4dd812e9abc62e Mon Sep 17 00:00:00 2001 From: alvinlollo <143326475+alvinlollo@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:27:32 +1100 Subject: [PATCH] Implement backup removal and creation for LazyVim Added backup removal and creation for LazyVim installation. --- LazyVim.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/LazyVim.sh b/LazyVim.sh index 920637e..c654a6d 100644 --- a/LazyVim.sh +++ b/LazyVim.sh @@ -1,7 +1,32 @@ # Install prerequisetes sudo pacman -S --needed --noconfirm git curl wget python3 python-pip -# LazyVim Install +# Remove old backups +if [ -e "~/.config/nvim.bak" ]; then + # The path exists (it could be a file, a directory, a symlink, etc.) + echo "Path ~/.config/nvim.bak exists. Running command..." + rm -rf ~/.config/nvim.bak +fi + +if [ -e "~/.local/share/nvim.bak" ]; then + # The path exists (it could be a file, a directory, a symlink, etc.) + echo "Path ~/.local/share/nvim.bak exists. Running command..." + rm -rf ~/.local/share/nvim.bak +fi + +if [ -e "~/.local/state/nvim.bak" ]; then + # The path exists (it could be a file, a directory, a symlink, etc.) + echo "Path ~/.local/state/nvim.bak exists. Running command..." + rm -rf ~/.local/state/nvim.bak +fi + +if [ -e "~/.cache/nvim.bak" ]; then + # The path exists (it could be a file, a directory, a symlink, etc.) + echo "Path ~/.cache/nvim.bak exists. Running command..." + rm -rf ~/.cache/nvim.bak +fi + +# LazyVim Backup mv ~/.config/nvim{,.bak} # optional but recommended