summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-01-21 19:03:35 +0100
committerMarc Cornellà <hello@mcornella.com>2022-01-22 22:07:09 +0100
commit84931adcd465e9a3b5e38f3b416a1df2acc33801 (patch)
treeb0eb1d7a9dc6ec8ac42b52a1d68a9c458ec9ccef /tools
parent4e0f19cf923163104d86308d2366d37da35c0622 (diff)
downloadzsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.tar.gz
zsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.tar.bz2
zsh-84931adcd465e9a3b5e38f3b416a1df2acc33801.zip
fix: do not call chpwd hooks in subshells
Diffstat (limited to 'tools')
-rw-r--r--tools/check_for_upgrade.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 729d8ecb5..3f6d35c3e 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -36,11 +36,11 @@ function current_epoch() {
function is_update_available() {
local branch
- branch=${"$(cd "$ZSH"; git config --local oh-my-zsh.branch)":-master}
+ branch=${"$(cd -q "$ZSH"; git config --local oh-my-zsh.branch)":-master}
local remote remote_url remote_repo
- remote=${"$(cd "$ZSH"; git config --local oh-my-zsh.remote)":-origin}
- remote_url=$(cd "$ZSH"; git config remote.$remote.url)
+ remote=${"$(cd -q "$ZSH"; git config --local oh-my-zsh.remote)":-origin}
+ remote_url=$(cd -q "$ZSH"; git config remote.$remote.url)
local repo
case "$remote_url" in
@@ -58,7 +58,7 @@ function is_update_available() {
# Get local HEAD. If this fails assume there are updates
local local_head
- local_head=$(cd "$ZSH"; git rev-parse $branch 2>/dev/null) || return 0
+ local_head=$(cd -q "$ZSH"; git rev-parse $branch 2>/dev/null) || return 0
# Get remote HEAD. If no suitable command is found assume there are updates
# On any other error, skip the update (connection may be down)
@@ -136,7 +136,7 @@ function update_ohmyzsh() {
fi
# Test if Oh My Zsh directory is a git repository
- if ! (cd "$ZSH" && LANG= git rev-parse &>/dev/null); then
+ if ! (cd -q "$ZSH" && LANG= git rev-parse &>/dev/null); then
echo >&2 "[oh-my-zsh] Can't update: not a git repository."
return
fi