From 0066280c3e971e1e45a9037f6d0b993dabcc3576 Mon Sep 17 00:00:00 2001 From: pomatory Date: Sun, 23 Oct 2022 02:52:26 +0800 Subject: [PATCH] fix(pip): fix `pipupall` error with `freeze` format (#11280) --- plugins/pip/pip.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index 7eb2d2a35..90e39e118 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -94,12 +94,12 @@ alias pipreq="pip freeze > requirements.txt" # Install packages from requirements file alias pipir="pip install -r requirements.txt" -# Update all installed packages +# Upgrade all installed packages function pipupall { # non-GNU xargs does not support nor need `--no-run-if-empty` local xargs="xargs --no-run-if-empty" xargs --version 2>/dev/null | grep -q GNU || xargs="xargs" - pip list --outdated --format freeze | cut -d= -f1 | ${=xargs} pip install --upgrade + pip list --outdated | awk 'NR > 2 { print $1 }' | ${=xargs} pip install --upgrade } # Uninstalled all installed packages