From 0563a01c9678951647269b67851531e1f39415b1 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Sun, 3 Nov 2024 21:51:35 +0100 Subject: [PATCH] enhance clear_files function: add checks for .bashrc and .profile to prevent conflicts --- setup.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 2598e18..06cd769 100755 --- a/setup.sh +++ b/setup.sh @@ -57,10 +57,18 @@ clear_files() { sudo ln -s $HOME/dotfiles/config/nixos/configuration.nix /etc/nixos/configuration.nix # Confirm paths are now proper symlinks - if [ -L $HOME/.bashrc ] && [ -L ~/.config/home-manager ] && [ -L /etc/nixos/configuration.nix ]; then - tput setaf 2 - echo "Symlinks set up successfully." - tput sgr0 + if [ -L ~/.config/home-manager ] && [ -L /etc/nixos/configuration.nix ]; then + # Confirm .bashrc and .profile are no longer present to prevent conflicts in nixoos-rebuild/home-manager switch + if [ ! -f $HOME/.bashrc ] && [ ! -f $HOME/.profile ]; then + tput setaf 2 + echo "Symlinks set up successfully." + tput sgr0 + else + tput setaf 1 + echo "Failed to set up symlinks. Exiting..." + tput sgr0 + exit 1 + fi else tput setaf 1 echo "Failed to set up symlinks. Exiting..."