diff --git a/local/share/updateall/commands.d/.pip b/local/share/updateall/commands.d/.pip new file mode 100644 index 0000000..159a84f --- /dev/null +++ b/local/share/updateall/commands.d/.pip @@ -0,0 +1,13 @@ +# Gathering the outdated packages list +echo "Gathering the outdated packages list..." +py_pkglist=$(pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d '=' -f 1) + +# Updating +if [ ! -z "$py_pkglist" ]; then + echo $py_pkglist | xargs -n 1 pip3 install -U +else + echo "All packages are up to date." +fi + +# Unsetting the variable +unset py_pkglist diff --git a/local/share/updateall/commands.d/git b/local/share/updateall/commands.d/git new file mode 100644 index 0000000..f987e57 --- /dev/null +++ b/local/share/updateall/commands.d/git @@ -0,0 +1,14 @@ +if [[ -d ~/Git ]]; then + pushd "${HOME}/Git" > /dev/null + for repo in ./*; do + cd "$repo" + echo + basename "$repo" + git pull + cd .. + done + popd > /dev/null +else + >&2 echo "\"~/Git\" does not exist!" +fi + diff --git a/local/share/updateall/commands.d/npm b/local/share/updateall/commands.d/npm new file mode 100644 index 0000000..9cb29c8 --- /dev/null +++ b/local/share/updateall/commands.d/npm @@ -0,0 +1,8 @@ +# Moving to /tmp folder +#pushd /tmp > /dev/null + +# Updating +sudo npm -g update + +# Returning to previous directory +#popd > /dev/null diff --git a/local/share/updateall/commands.d/pacman b/local/share/updateall/commands.d/pacman new file mode 100644 index 0000000..92e77e1 --- /dev/null +++ b/local/share/updateall/commands.d/pacman @@ -0,0 +1,11 @@ +# Gathering orphaned packages list +echo "Gathering orphaned packages list..." +orphaned_packages="$(pacman -Qtdq)" + +if [[ ! -z $orphaned_packages ]]; then + echo "$orphaned_packages" | sudo pacman -Rns - +else + echo "No package to be removed." +fi + +unset orphaned_packages diff --git a/local/share/updateall/commands.d/yay b/local/share/updateall/commands.d/yay new file mode 100644 index 0000000..8fdfb76 --- /dev/null +++ b/local/share/updateall/commands.d/yay @@ -0,0 +1,2 @@ +# Updating +yay -Syu