fish: add npm upgrade function

This commit is contained in:
Charles Gould 2020-04-28 21:24:20 -05:00
parent 576ff624d6
commit 643952f7c4
2 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,12 @@
function npm_upgrade --description "Upgrade npm packages"
set --local npm_pkgs_outdated (npm outdated -g --depth=0)
if test (count $py_pkgs_outdated) = 0
echo "All packages up-to-date."
else
echo "Outdated packages: $npm_pkgs_outdated"
if confirm
npm update -g
end
end
end

View File

@ -4,8 +4,11 @@ function pip_upgrade --description "Upgrade python packages"
if test (count $py_pkgs_outdated) = 0 if test (count $py_pkgs_outdated) = 0
echo "All packages up-to-date." echo "All packages up-to-date."
else else
for py_pkg in $py_pkgs_outdated echo "Outdated packages: $py_pkgs_outdated"
pip3 install $py_pkg -U if confirm
for py_pkg in $py_pkgs_outdated
pip3 install -U $py_pkg
end
end end
end end
end end