mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Merge branch 'master' of github.com:fklassen/ohmyzsh
* 'master' of github.com:fklassen/ohmyzsh: (38 commits) fix(aws): restore accidentally deleted variable feat(upgrade): add verbosity settings fix(uninstall): abort uninstall if unable to change shell (#10357) feat(juju): add functions to get current controller and model (#11572) fix(aws): do not print region if it's not defined feat(aws): set region when AWS_REGION is not set feat(gnu-utils): add `gindent` (#11569) fix(lib): set equivalent LS_COLORS and LSCOLORS variables feat(rails): add `rta` alias (#11553) docs(vi-mode): document how to add vi-mode info on the prompt (#11548) Fixing link to PA website in README feat(vi-mode): add settings for vi-mode cursor styles (#10860) fix(init): set completion colors on theme load, not with `precmd` feat(aws): add AWS_REGION to aws_prompt_info (#10062) fix(aliases): group properly aliases (#11546) fix(argocd): typo in filename feat(argocd): add completion plugin refactor(theme-and-appearance): reorganize and clean up logic (#11529) fix(lib): use `$BROWSER` in `open_command` if set (#11532) docs(brew): remove duplication (#11535) ... Conflicts: oh-my-zsh.sh
This commit is contained in:
commit
21c511d24e
47 changed files with 1103 additions and 155 deletions
|
|
@ -95,7 +95,8 @@ function update_last_updated_file() {
|
|||
}
|
||||
|
||||
function update_ohmyzsh() {
|
||||
if ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive; then
|
||||
zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default
|
||||
if ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode; then
|
||||
update_last_updated_file
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
|
||||
old_shell=$(cat ~/.shell.pre-oh-my-zsh)
|
||||
echo "Switching your shell back to '$old_shell':"
|
||||
if chsh -s "$old_shell"; then
|
||||
rm -f ~/.shell.pre-oh-my-zsh
|
||||
else
|
||||
echo "Could not change default shell. Change it manually by running chsh"
|
||||
echo "or editing the /etc/passwd file."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
read -r -p "Are you sure you want to remove Oh My Zsh? [y/N] " confirmation
|
||||
if [ "$confirmation" != y ] && [ "$confirmation" != Y ]; then
|
||||
echo "Uninstall cancelled"
|
||||
|
|
@ -25,16 +37,5 @@ else
|
|||
echo "No original zsh config found"
|
||||
fi
|
||||
|
||||
if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
|
||||
old_shell=$(cat ~/.shell.pre-oh-my-zsh)
|
||||
echo "Switching your shell back to '$old_shell':"
|
||||
if chsh -s "$old_shell"; then
|
||||
rm -f ~/.shell.pre-oh-my-zsh
|
||||
else
|
||||
echo "Could not change default shell. Change it manually by running chsh"
|
||||
echo "or editing the /etc/passwd file."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
|
||||
echo "Don't forget to restart your terminal!"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,23 @@ esac
|
|||
|
||||
cd "$ZSH"
|
||||
|
||||
verbose_mode="default"
|
||||
interactive=false
|
||||
|
||||
while getopts "v:i" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
if [[ $OPTARG == default || $OPTARG == minimal || $OPTARG == silent ]]; then
|
||||
verbose_mode=$OPTARG
|
||||
else
|
||||
echo "[oh-my-zsh] update verbosity '$OPTARG' is not valid"
|
||||
echo "[oh-my-zsh] valid options are 'default', 'minimal' and 'silent'"
|
||||
fi
|
||||
;;
|
||||
i) interactive=true ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Use colors, but only if connected to a terminal
|
||||
# and that terminal supports them.
|
||||
|
||||
|
|
@ -203,7 +220,9 @@ git checkout -q "$branch" -- || exit 1
|
|||
last_commit=$(git rev-parse "$branch")
|
||||
|
||||
# Update Oh My Zsh
|
||||
printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
|
||||
if [[ $verbose_mode != silent ]]; then
|
||||
printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
|
||||
fi
|
||||
if LANG= git pull --quiet --rebase $remote $branch; then
|
||||
# Check if it was really updated or not
|
||||
if [[ "$(git rev-parse HEAD)" = "$last_commit" ]]; then
|
||||
|
|
@ -215,24 +234,30 @@ if LANG= git pull --quiet --rebase $remote $branch; then
|
|||
git config oh-my-zsh.lastVersion "$last_commit"
|
||||
|
||||
# Print changelog to the terminal
|
||||
if [[ "$1" = --interactive ]]; then
|
||||
if [[ interactive == true && $verbose_mode == default ]] ; then
|
||||
"$ZSH/tools/changelog.sh" HEAD "$last_commit"
|
||||
fi
|
||||
|
||||
printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog"
|
||||
if [[ $verbose_mode != silent ]]; then
|
||||
printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
|
||||
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
|
||||
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
|
||||
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
|
||||
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
|
||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||
printf '\n'
|
||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"
|
||||
if [[ $verbose_mode == default ]]; then
|
||||
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
|
||||
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
|
||||
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
|
||||
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
|
||||
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
|
||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||
printf '\n'
|
||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"
|
||||
elif [[ $verbose_mode == minimal ]]; then
|
||||
printf "${BLUE}%s${RESET}\n" "$message"
|
||||
fi
|
||||
else
|
||||
ret=$?
|
||||
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue