1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Larson Carter
ce28ac42c8
Modernize install and update banners (#9045) 2020-06-28 22:06:13 +02:00
Marc Cornellà
97cf0bf4bd update: change dash in function name for sh compat (fixes #9064) 2020-06-28 18:54:59 +02:00
alexagnelli
48b98b957e
update: only update on a valid affirmative input (#9062)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-06-28 18:34:02 +02:00
3 changed files with 12 additions and 11 deletions

View File

@ -19,13 +19,13 @@ function current_epoch() {
echo $(( EPOCHSECONDS / 60 / 60 / 24 ))
}
function update_last-updated_file() {
function update_last_updated_file() {
echo "LAST_EPOCH=$(current_epoch)" >! "${ZSH_CACHE_DIR}/.zsh-update"
}
function update_ohmyzsh() {
ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh"
update_last-updated_file
update_last_updated_file
}
() {
@ -55,7 +55,7 @@ function update_ohmyzsh() {
# Create or update .zsh-update file if missing or malformed
if ! source "${ZSH_CACHE_DIR}/.zsh-update" 2>/dev/null || [[ -z "$LAST_EPOCH" ]]; then
update_last-updated_file
update_last_updated_file
return
fi
@ -79,10 +79,10 @@ function update_ohmyzsh() {
read -r -k 1 option
[[ "$option" != $'\n' ]] && echo
case "$option" in
[nN]) update_last-updated_file ;;
*) update_ohmyzsh ;;
[yY$'\n']) update_ohmyzsh ;;
[nN]) update_last_updated_file ;;
esac
fi
}
unset -f current_epoch update_last-updated_file update_ohmyzsh
unset -f current_epoch update_last_updated_file update_ohmyzsh

View File

@ -269,11 +269,11 @@ main() {
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
Before your scream Oh My Zsh! please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us on https://twitter.com/ohmyzsh
p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh
• Follow us on Twitter: https://twitter.com/ohmyzsh
• Join our Discord server: https://discord.gg/ohmyzsh
• Get stickers, shirts, coffee mugs and other swag: https://shop.planetargon.com/collections/oh-my-zsh
EOF
printf "$RESET"

View File

@ -62,7 +62,8 @@ then
printf '%s\____/%s_/ /_/ %s /_/ /_/ /_/%s\__, / %s /___/%s____/%s_/ /_/ %s\n' $RB_RED $RB_ORANGE $RB_YELLOW $RB_GREEN $RB_BLUE $RB_INDIGO $RB_VIOLET $RB_RESET
printf '%s %s %s %s /____/ %s %s %s %s\n' $RB_RED $RB_ORANGE $RB_YELLOW $RB_GREEN $RB_BLUE $RB_INDIGO $RB_VIOLET $RB_RESET
printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version."
printf "${BLUE}${BOLD}%s${RESET}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh"
printf "${BLUE}${BOLD}%s${RESET}\n" "To keep up on the latest news and updates, follow us on Twitter: https://twitter.com/ohmyzsh"
printf "${BLUE}${BOLD}%s${RESET}\n" "Want to get involved in the community? Join our Discord: https://discord.gg/ohmyzsh"
printf "${BLUE}${BOLD}%s${RESET}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh"
else
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'