1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-11 00:10:08 +00:00

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
This commit is contained in:
M. Yas. Davoodeh 2020-07-13 14:22:28 +04:30 committed by GitHub
parent e3131d98aa
commit 5c1a5c6ce9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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