From 5c1a5c6ce924755095020fd829b08f0ee205a723 Mon Sep 17 00:00:00 2001
From: "M. Yas. Davoodeh" <30480116+MYDavoodeh@users.noreply.github.com>
Date: Mon, 13 Jul 2020 14:22:28 +0430
Subject: [PATCH] update: prefix rm call with command in trap (#9107)

* Suppress the problematic trap output in check_upg

The newly added trap, in systems where `rm` is aliased to `rm="rm -v"`,
shows a message stating that "update.lock" has been removed each time `zsh` is called.
I simply suppressed it with directing the output to `/dev/null`.

* Use `command` instead of >/dev/null to suppress
---
 tools/check_for_upgrade.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index c91431c25..cadd5fe49 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -51,7 +51,7 @@ function update_ohmyzsh() {
     #  The return status from the function is handled specially. If it is zero, the signal is
     #  assumed to have been handled, and execution continues normally. Otherwise, the shell
     #  will behave as interrupted except that the return status of the trap is retained.
-    trap "rm -rf '$ZSH/log/update.lock'; return 1" EXIT INT QUIT
+    trap "command rm -rf '$ZSH/log/update.lock'; return 1" EXIT INT QUIT
 
     # Create or update .zsh-update file if missing or malformed
     if ! source "${ZSH_CACHE_DIR}/.zsh-update" 2>/dev/null || [[ -z "$LAST_EPOCH" ]]; then
-- 
2.21.0