-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop-the-warnings.diff
178 lines (155 loc) · 6.31 KB
/
stop-the-warnings.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
diff --git a/lib/cli.zsh b/lib/cli.zsh
index 561c1b9..d3bac43 100644
--- a/lib/cli.zsh
+++ b/lib/cli.zsh
@@ -776,7 +776,7 @@ function _omz::update {
local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD)
# Run update script
- zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default
+ zstyle -s ':omz:update' verbose verbose_mode || local verbose_mode=default
if [[ "$1" != --unattended ]]; then
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $?
else
diff --git a/lib/grep.zsh b/lib/grep.zsh
index 54e0f69..24aab4b 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -1,7 +1,7 @@
-__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias
+typeset -g __GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias
# See if there's a cache file modified in the last day
-__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1))
+typeset -g __GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1))
if [[ -n "$__GREP_ALIAS_CACHES" ]]; then
source "$__GREP_CACHE_FILE"
else
@@ -10,15 +10,15 @@ else
}
# Ignore these folders (if the necessary grep flags are available)
- EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
+ typeset -g EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
# Check for --exclude-dir, otherwise check for --exclude. If --exclude
# isn't available, --color won't be either (they were released at the same
# time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
if grep-flags-available --color=auto --exclude-dir=.cvs; then
- GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS"
+ typeset -g GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS"
elif grep-flags-available --color=auto --exclude=.cvs; then
- GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS"
+ typeset -g GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS"
fi
if [[ -n "$GREP_OPTIONS" ]]; then
diff --git a/lib/misc.zsh b/lib/misc.zsh
index ff20177..f1c2ea2 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -1,4 +1,5 @@
autoload -Uz is-at-least
+local d
# *-magic is known buggy in some versions; disable if so
if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
index 3dc9b6d..6d1cb8e 100644
--- a/lib/prompt_info_functions.zsh
+++ b/lib/prompt_info_functions.zsh
@@ -34,7 +34,7 @@ function rvm_prompt_info() {
echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt:gs/%/%%}${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
}
-ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
+typeset -g ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
# use this to enable users to see their ruby version, no matter which
diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
index 97f5c36..2448a87 100644
--- a/lib/spectrum.zsh
+++ b/lib/spectrum.zsh
@@ -3,6 +3,7 @@
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
+local color
FX=(
reset "%{[00m%}"
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index d170ffc..65e75bf 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -38,11 +38,11 @@ function title {
esac
}
-ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
-ZSH_THEME_TERM_TITLE_IDLE="%n@%m:%~"
+typeset -g ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
+typeset -g ZSH_THEME_TERM_TITLE_IDLE="%n@%m:%~"
# Avoid duplication of directory in terminals with independent dir display
if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
- ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
+ typeset -g ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 585e969..5dd5339 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -5,12 +5,12 @@ autoload -U colors && colors
setopt prompt_subst
# Prompt function theming defaults
-ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Beginning of the git prompt, before the branch name
-ZSH_THEME_GIT_PROMPT_SUFFIX=")" # End of the git prompt
-ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
-ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
-ZSH_THEME_RUBY_PROMPT_PREFIX="("
-ZSH_THEME_RUBY_PROMPT_SUFFIX=")"
+typeset -g ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Beginning of the git prompt, before the branch name
+typeset -g ZSH_THEME_GIT_PROMPT_SUFFIX=")" # End of the git prompt
+typeset -g ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
+typeset -g ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
+typeset -g ZSH_THEME_RUBY_PROMPT_PREFIX="("
+typeset -g ZSH_THEME_RUBY_PROMPT_SUFFIX=")"
# Use diff --color if available
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index bee9eb6..1f00a05 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -1,5 +1,6 @@
# Git version checking
autoload -Uz is-at-least
+local git_version
git_version="${${(As: :)$(git version 2>/dev/null)}[3]}"
#
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 1cc193b..85f99fa 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -155,7 +155,7 @@ function handle_update() {
() {
emulate -L zsh
- local epoch_target mtime option LAST_EPOCH
+ local epoch_target mtime option LAST_EPOCH ret
# Remove lock directory if older than a day
zmodload zsh/datetime
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index f7a263d..5267831 100755
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -15,8 +15,8 @@ esac
cd "$ZSH"
-verbose_mode="default"
-interactive=false
+local verbose_mode="default"
+local interactive=false
while getopts "v:i" opt; do
case $opt in
@@ -252,6 +252,15 @@ if LANG= git pull --quiet --rebase $remote $branch; then
fi
fi
+ printf "\n${BLUE}%s${RESET}\n" "Updating custom plugins and themes"
+ cd custom/
+ for plugin in plugins/*/ themes/*/; do
+ if [ -d "$plugin/.git" ]; then
+ printf "${YELLOW}%s${RESET}\n" "${plugin%/}"
+ git -C "$plugin" pull
+ fi
+ done
+
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