fish: add npm upgrade function
This commit is contained in:
parent
576ff624d6
commit
643952f7c4
12
fish/functions/npm_upgrade.fish
Normal file
12
fish/functions/npm_upgrade.fish
Normal 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
|
@ -4,8 +4,11 @@ function pip_upgrade --description "Upgrade python packages"
|
||||
if test (count $py_pkgs_outdated) = 0
|
||||
echo "All packages up-to-date."
|
||||
else
|
||||
for py_pkg in $py_pkgs_outdated
|
||||
pip3 install $py_pkg -U
|
||||
echo "Outdated packages: $py_pkgs_outdated"
|
||||
if confirm
|
||||
for py_pkg in $py_pkgs_outdated
|
||||
pip3 install -U $py_pkg
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user