mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
fix(installer): update user prompt to match existing style
This commit is contained in:
parent
187140f735
commit
643c35de9e
1 changed files with 8 additions and 6 deletions
|
|
@ -344,12 +344,14 @@ setup_zshrc() {
|
||||||
# Ask user for confirmation before backing up and overwriting
|
# Ask user for confirmation before backing up and overwriting
|
||||||
echo "${FMT_YELLOW}Found ${zdot}/.zshrc."
|
echo "${FMT_YELLOW}Found ${zdot}/.zshrc."
|
||||||
echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten."
|
echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten."
|
||||||
read -p "Do you want to overwrite it with the Oh My Zsh template? [Y/n]${FMT_RESET} " response
|
printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \
|
||||||
response="$(printf '%s' "$response" | tr '[:upper:]' '[:lower:]')" # Convert to lowercase
|
"$FMT_YELLOW" "$FMT_RESET"
|
||||||
if [ "$response" = "n" ]; then
|
read -r opt
|
||||||
echo "${FMT_GREEN}Skipping overwrite. Existing .zshrc will be kept.${FMT_RESET}"
|
case $opt in
|
||||||
return
|
[Yy]*|"") ;;
|
||||||
fi
|
[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
|
if [ -e "$OLD_ZSHRC" ]; then
|
||||||
OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"
|
OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"
|
||||||
if [ -e "$OLD_OLD_ZSHRC" ]; then
|
if [ -e "$OLD_OLD_ZSHRC" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue