From 6df4c622ae08b00952a94db26cba5d6da66b7685 Mon Sep 17 00:00:00 2001 From: dyi919 Date: Sat, 24 May 2025 14:21:52 +0900 Subject: [PATCH] fix(installer): add a message to notify minimal configuration requirement --- tools/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/install.sh b/tools/install.sh index 665eb9035..d274c2c9f 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -341,9 +341,14 @@ setup_zshrc() { echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}" return fi + # Ask user for confirmation before backing up and overwriting echo "${FMT_YELLOW}Found ${zdot}/.zshrc." echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ "$FMT_YELLOW" "$FMT_RESET" read -r opt @@ -352,6 +357,7 @@ setup_zshrc() { [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; esac + if [ -e "$OLD_ZSHRC" ]; then OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" if [ -e "$OLD_OLD_ZSHRC" ]; then