浏览代码

feat(pip): alias `pip` to `pip3` if pip is missing (#10431)

Carlo Sala 3 年之前
父节点
当前提交
79531f7013
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      plugins/pip/pip.plugin.zsh

+ 5 - 1
plugins/pip/pip.plugin.zsh

@@ -82,7 +82,11 @@ zsh-pip-test-clean-packages() {
     fi
 }
 
-alias pip="noglob pip" # allows square brackets for pip command invocation
+if (( $+commands[pip3] && !$+commands[pip] )); then
+  alias pip="noglob pip3"
+else
+  alias pip="noglob pip"
+fi
 
 # Create requirements file
 alias pipreq="pip freeze > requirements.txt"