Skip to content

Commit

Permalink
init: silence zcompdump metadata write for invalid ZSH_COMPDUMP filen…
Browse files Browse the repository at this point in the history
…ames

If `$SHORT_HOST` contains invalid filename characters, the compinit call doesn't
error, but the zcompdump metadata write does. Use `tee` instead so we can silence
the error.

See ohmyzsh@dd1a726#commitcomment-38984764
  • Loading branch information
mcornella committed May 7, 2020
1 parent 0736a37 commit b876198
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oh-my-zsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi

# Append zcompdump metadata if missing
if (( $zcompdump_refresh )); then
echo "\n$zcompdump_metadata" >>! "$ZSH_COMPDUMP"
echo "\n$zcompdump_metadata" | tee -a "$ZSH_COMPDUMP" &>/dev/null
fi

unset zcompdump_metadata zcompdump_refresh
Expand Down

0 comments on commit b876198

Please sign in to comment.