mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-30 20:04:19 +08:00
Compare commits
2 Commits
079e7bb5e0
...
7deda85f8c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7deda85f8c | ||
|
|
613045e7e5 |
@ -201,10 +201,14 @@ function _omz::pr::test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _omz::update {
|
function _omz::update {
|
||||||
|
# Run update script
|
||||||
env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh"
|
env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh"
|
||||||
# Update last updated file
|
# Update last updated file
|
||||||
zmodload zsh/datetime
|
zmodload zsh/datetime
|
||||||
echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update"
|
echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update"
|
||||||
# Remove update lock if it exists
|
# Remove update lock if it exists
|
||||||
command rm -rf "$ZSH/log/update.lock"
|
command rm -rf "$ZSH/log/update.lock"
|
||||||
|
# Restart the zsh session
|
||||||
|
_omz::log info "restarting the zsh session..."
|
||||||
|
[[ -z "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,20 @@ function uninstall_oh_my_zsh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function upgrade_oh_my_zsh() {
|
function upgrade_oh_my_zsh() {
|
||||||
echo >&2 "${fg[yellow]}Note: \`$0\` is deprecated. Use \`omz update\` instead.$reset_color"
|
if (( $+functions[_omz::update] )); then
|
||||||
omz update
|
echo >&2 "${fg[yellow]}Note: \`$0\` is deprecated. Use \`omz update\` instead.$reset_color"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run update script
|
||||||
|
env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh"
|
||||||
|
# Update last updated file
|
||||||
|
zmodload zsh/datetime
|
||||||
|
echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update"
|
||||||
|
# Remove update lock if it exists
|
||||||
|
command rm -rf "$ZSH/log/update.lock"
|
||||||
|
# Restart the zsh session
|
||||||
|
_omz::log info "restarting the zsh session..."
|
||||||
|
[[ -z "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||||
}
|
}
|
||||||
|
|
||||||
function take() {
|
function take() {
|
||||||
|
|||||||
@ -53,6 +53,10 @@ error() {
|
|||||||
echo ${RED}"Error: $@"${RESET} >&2
|
echo ${RED}"Error: $@"${RESET} >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
underline() {
|
||||||
|
echo "$(printf '\033[4m')$@$(printf '\033[24m')"
|
||||||
|
}
|
||||||
|
|
||||||
setup_color() {
|
setup_color() {
|
||||||
# Only use colors if connected to a terminal
|
# Only use colors if connected to a terminal
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
@ -269,11 +273,13 @@ main() {
|
|||||||
/____/ ....is now installed!
|
/____/ ....is now installed!
|
||||||
|
|
||||||
|
|
||||||
|
EOF
|
||||||
|
cat <<-EOF
|
||||||
Before you scream Oh My Zsh! please look over the ~/.zshrc file to select plugins, themes, and options.
|
Before you scream Oh My Zsh! please look over the ~/.zshrc file to select plugins, themes, and options.
|
||||||
|
|
||||||
• Follow us on Twitter: https://twitter.com/ohmyzsh
|
• Follow us on Twitter: $(underline https://twitter.com/ohmyzsh)
|
||||||
• Join our Discord server: https://discord.gg/ohmyzsh
|
• Join our Discord server: $(underline https://discord.gg/ohmyzsh)
|
||||||
• Get stickers, shirts, coffee mugs and other swag: https://shop.planetargon.com/collections/oh-my-zsh
|
• Get stickers, shirts, coffee mugs and other swag: $(underline https://shop.planetargon.com/collections/oh-my-zsh)
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
printf "$RESET"
|
printf "$RESET"
|
||||||
|
|||||||
@ -14,6 +14,7 @@ if [ -t 1 ]; then
|
|||||||
YELLOW=$(printf '\033[33m')
|
YELLOW=$(printf '\033[33m')
|
||||||
BLUE=$(printf '\033[34m')
|
BLUE=$(printf '\033[34m')
|
||||||
BOLD=$(printf '\033[1m')
|
BOLD=$(printf '\033[1m')
|
||||||
|
UNDER=$(printf '\033[4m')
|
||||||
RESET=$(printf '\033[m')
|
RESET=$(printf '\033[m')
|
||||||
else
|
else
|
||||||
RB_RED=""
|
RB_RED=""
|
||||||
@ -28,6 +29,7 @@ else
|
|||||||
GREEN=""
|
GREEN=""
|
||||||
YELLOW=""
|
YELLOW=""
|
||||||
BLUE=""
|
BLUE=""
|
||||||
|
UNDER=""
|
||||||
BOLD=""
|
BOLD=""
|
||||||
RESET=""
|
RESET=""
|
||||||
fi
|
fi
|
||||||
@ -62,9 +64,9 @@ 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 '%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}%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 ${UNDER}%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 ${UNDER}%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"
|
printf "${BLUE}${BOLD}%s ${UNDER}%s${RESET}\n" "Get your Oh My Zsh swag at:" "https://shop.planetargon.com/collections/oh-my-zsh"
|
||||||
else
|
else
|
||||||
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
|
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user