diff --git a/fish/functions/npm_upgrade.fish b/fish/functions/npm_upgrade.fish new file mode 100644 index 0000000..4598b0b --- /dev/null +++ b/fish/functions/npm_upgrade.fish @@ -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 diff --git a/fish/functions/pip_upgrade.fish b/fish/functions/pip_upgrade.fish index a0f8517..b3b35f8 100644 --- a/fish/functions/pip_upgrade.fish +++ b/fish/functions/pip_upgrade.fish @@ -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