Add dedicated alias file for each OS/Variant

Add a single 'upgrade' command which will do a full OS upgrade without
any prompts.
This commit is contained in:
John Mertz 2023-04-12 21:30:03 -04:00
parent bcfd4c1a45
commit 5ee86b0366
6 changed files with 19 additions and 2 deletions

View File

@ -17,8 +17,6 @@ alias fuck='sudo "$BASH" -c "$(history -p !!)"'
alias diff="diff --side-by-side --left-column -W \$COLUMNS" alias diff="diff --side-by-side --left-column -W \$COLUMNS"
# OS functions (TODO: should be broken out and pulled in based on OS) # OS functions (TODO: should be broken out and pulled in based on OS)
alias apt-all="sudo apt-get update; sudo apt-get full-upgrade -y; sudo apt-get autoremove -y; sudo apt-get clean -y;"
alias rpm-all="rpm-ostree upgrade"
alias pip-upgrade="pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U" alias pip-upgrade="pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U"
# Legacy mappings # Legacy mappings
@ -59,3 +57,17 @@ if [ "$(isdistrobox)" ]; then
else else
source "$HOME/.dotfiles/bash/bash_aliases.host" source "$HOME/.dotfiles/bash/bash_aliases.host"
fi fi
if [ -f /etc/os-release ]; then
export OS=`grep -P '^ID=' /etc/os-release | cut -d'=' -f2 | sed 's/"//g'`
if [ -f ${HOME}/.dotfiles/bash/bash_aliases.$OS ]; then
source ${HOME}/.dotfiles/bash/bash_aliases.$OS
fi
OSVARIANT=`grep -P '^VARIANT_ID=' /etc/os-release | cut -d'=' -f2 | sed 's/"//g'`
if [ -z $OSVARIANT ]; then
export OSVARIANT
fi
if [ -f ${HOME}/.dotfiles/bash/bash_aliases.$OS-$OSVARIANT ]; then
source ${HOME}/.dotfiles/bash/bash_aliases.$OS-$OSVARIANT
fi
fi

1
bash/bash_aliases.arch Normal file
View File

@ -0,0 +1 @@
alias upgrade="sudo pacman -Syyu --noconfirm"

1
bash/bash_aliases.debian Normal file
View File

@ -0,0 +1 @@
alias upgrade="sudo apt-get update; sudo apt-get full-upgrade -y; sudo apt-get autoremove -y; sudo apt-get clean -y;"

1
bash/bash_aliases.fedora Normal file
View File

@ -0,0 +1 @@
alias upgrade="sudo dnf upgrade -y"

View File

@ -0,0 +1 @@
alias upgrade="sudo rpm-ostree upgrade"

1
bash/bash_aliases.ubuntu Normal file
View File

@ -0,0 +1 @@
alias upgrade="sudo apt-get update; sudo apt-get full-upgrade -y; sudo apt-get autoremove -y; sudo apt-get clean -y;"