From 1e5e834e0f6486a569efd6b12ce4e33624fef0c9 Mon Sep 17 00:00:00 2001
From: Sina Tak Tehrani <ssttehrani@gmail.com>
Date: Mon, 25 Oct 2021 20:28:22 +0200
Subject: [PATCH] fix(cli): exit `omz update` with correct error code (#10342)

---
 lib/cli.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cli.zsh b/lib/cli.zsh
index 4b14360c1..0b6bbc6cb 100644
--- a/lib/cli.zsh
+++ b/lib/cli.zsh
@@ -755,9 +755,9 @@ function _omz::update {
 
   # Run update script
   if [[ "$1" != --unattended ]]; then
-    ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive
+    ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive || return $?
   else
-    ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh"
+    ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" || return $?
   fi
 
   # Update last updated file
-- 
2.21.0