From ddf673b36dd43e5ca60189a117c25ad6f55457e7 Mon Sep 17 00:00:00 2001 From: MikuHatsune39 <32179075+MikuHatsune39@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:35:46 -0800 Subject: [PATCH] fix(python): set `py` alias if `py` is not installed (#12059) Co-authored-by: Carlo Sala --- plugins/python/README.md | 2 +- plugins/python/python.plugin.zsh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 97c1a34ee..7bf1b34ac 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -12,7 +12,7 @@ plugins=(... python) | Command | Description | | ---------------- | -------------------------------------------------------------------------------------- | -| `py` | Runs `python3` | +| `py` | Runs `python3`. Only set if `py` is not installed. | | `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv | | `pyfind` | Finds .py files recursively in the current directory | | `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one | diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 2fbb59577..3d7ca55c9 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -1,5 +1,5 @@ -# python command -alias py='python3' +# set python command if 'py' not installed +builtin which py > /dev/null || alias py='python3' # Find python file alias pyfind='find . -name "*.py"'