Skip to content

Commit

Permalink
Fix backup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Sep 15, 2024
1 parent 55c6db1 commit 9228327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tabs/applications-setup/mybash-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ installZoxide() {

linkConfig() {
OLD_BASHRC="$HOME/.bashrc"
if [ -e "$OLD_BASHRC" ]; then
if [ -e "$OLD_BASHRC" ] && [ ! -e "$HOME/.bashrc.bak" ]; then
printf "%b\n" "${YELLOW}Moving old bash config file to $HOME/.bashrc.bak${RC}"
if ! mv "$OLD_BASHRC" "$HOME/.bashrc.bak"; then
printf "%b\n" "${RED}Can't move the old bash config file!${RC}"
Expand All @@ -105,7 +105,7 @@ linkConfig() {
printf "%b\n" "${RED}Failed to create symbolic link for starship.toml${RC}"
exit 1
}
printf "%b\n" "${GREEN}Done!\nrestart your shell to see the changes.${RC}"
printf "%b\n" "${GREEN}Done! restart your shell to see the changes.${RC}"
}

checkEnv
Expand Down
4 changes: 3 additions & 1 deletion tabs/applications-setup/neovim-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ setupNeovim() {
}

backupNeovimConfig() {
[ -d "$HOME/.config/nvim" ] && cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup"
if [ -d "$HOME/.config/nvim" ] && [ ! -d "$HOME/.config/nvim-backup" ]; then
cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup"
fi
rm -rf "$HOME/.config/nvim"
}

Expand Down

0 comments on commit 9228327

Please sign in to comment.