浏览代码

init: reapply hack for invalid ZSH_COMPDUMP filenames (b8761985)

Marc Cornellà 4 年之前
父节点
当前提交
aee9e603b4
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      oh-my-zsh.sh

+ 3 - 1
oh-my-zsh.sh

@@ -85,7 +85,9 @@ fi
 
 
 # Append zcompdump metadata if missing
 # Append zcompdump metadata if missing
 if (( $zcompdump_refresh )); then
 if (( $zcompdump_refresh )); then
-  cat >>| "$ZSH_COMPDUMP" <<EOF
+  # Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error
+  # See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489
+  tee -a "$ZSH_COMPDUMP" &>/dev/null <<EOF
 
 
 $zcompdump_revision
 $zcompdump_revision
 $zcompdump_fpath
 $zcompdump_fpath