mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
fix(update): silence typeset
calls in upgrade.sh
script (#10048)
Co-authored-by: yyny <6576327+yyny@users.noreply.github.com>
This commit is contained in:
parent
4bd5d03e51
commit
b79726b1c3
1 changed files with 9 additions and 2 deletions
|
@ -1,16 +1,23 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Protect against running with shells other than zsh
|
||||||
if [ -z "$ZSH_VERSION" ]; then
|
if [ -z "$ZSH_VERSION" ]; then
|
||||||
exec zsh "$0" "$@"
|
exec zsh "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Protect against unwanted sourcing
|
||||||
|
case "$ZSH_EVAL_CONTEXT" in
|
||||||
|
*:file) echo "error: this file should not be sourced" && return ;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd "$ZSH"
|
cd "$ZSH"
|
||||||
|
|
||||||
# Use colors, but only if connected to a terminal
|
# Use colors, but only if connected to a terminal
|
||||||
# and that terminal supports them.
|
# and that terminal supports them.
|
||||||
|
|
||||||
local -a RAINBOW
|
setopt typeset_silent
|
||||||
local RED GREEN YELLOW BLUE BOLD DIM UNDER RESET
|
typeset -a RAINBOW
|
||||||
|
typeset RED GREEN YELLOW BLUE BOLD DIM UNDER RESET
|
||||||
|
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
RAINBOW=(
|
RAINBOW=(
|
||||||
|
|
Loading…
Reference in a new issue