adjusted to work with fishy shell

This commit is contained in:
JaKooLit
2025-03-24 16:59:28 +09:00
parent 78310220d4
commit 672a700695

View File

@@ -80,18 +80,20 @@ if command -v zsh >/dev/null; then
cp -r 'assets/.zprofile' ~/
# Check if the current shell is zsh
if [[ "$SHELL" != *"zsh"* ]]; then
current_shell=$(basename "$SHELL")
if [ "$current_shell" != "zsh" ]; then
printf "${NOTE} Changing default shell to ${MAGENTA}zsh${RESET}..."
printf "\n%.0s" {1..2}
while ! chsh -s $(which zsh); do
# Loop to ensure the chsh command succeeds
while ! chsh -s "$(command -v zsh)"; do
echo "${ERROR} Authentication failed. Please enter the correct password." 2>&1 | tee -a "$LOG"
sleep 1
done
printf "${INFO} Shell changed successfully to ${MAGENTA}zsh${RESET}" 2>&1 | tee -a "$LOG"
else
echo "${NOTE}Your shell is already set to ${MAGENTA}zsh${RESET}."
echo "${NOTE} Your shell is already set to ${MAGENTA}zsh${RESET}."
fi
fi