mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2025-04-29 17:25:34 +00:00
OSS program update script
This commit is contained in:
parent
e77fb9a73c
commit
4bc38eadc4
2
.zshrc
2
.zshrc
@ -16,7 +16,7 @@ alias e='emacs -nw'
|
|||||||
# Other
|
# Other
|
||||||
alias i='sudo dnf install'
|
alias i='sudo dnf install'
|
||||||
alias d='sudo dnf'
|
alias d='sudo dnf'
|
||||||
alias u='sudo dnf update; flatpak update'
|
alias u='sh ~/.config/scripts/update.sh'
|
||||||
alias dot='cd ~/dotfiles'
|
alias dot='cd ~/dotfiles'
|
||||||
# Git
|
# Git
|
||||||
alias c='git commit -m'
|
alias c='git commit -m'
|
||||||
|
50
scripts/update.sh
Normal file
50
scripts/update.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# This script is a catch all program updater.
|
||||||
|
|
||||||
|
# DNF Updater
|
||||||
|
function dnfUpdate {
|
||||||
|
if command -v dnf &> /dev/null; then
|
||||||
|
echo Updating DNF...
|
||||||
|
sudo dnf update
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Apt Updater
|
||||||
|
function aptUpdate {
|
||||||
|
if command -v apt &> /dev/null; then
|
||||||
|
echo Updating APT...
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Flatpack Updater
|
||||||
|
function flatpakUpdate {
|
||||||
|
if command -v flatpak &> /dev/null; then
|
||||||
|
echo Updating Flatpak...
|
||||||
|
flatpak update
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Checks if a program is installed and if it is runs an updater script
|
||||||
|
function updateProgram {
|
||||||
|
if command -v $1 &> /dev/null; then
|
||||||
|
sudo sh $2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Manually installed programs updater
|
||||||
|
function manualUpdate {
|
||||||
|
if command -v dnf &> /dev/null; then
|
||||||
|
echo Updating manually installed programs...
|
||||||
|
updateProgram bitwig-studio ~/.config/scripts/installers/bitwig-install.sh
|
||||||
|
updateProgram dragonframe ~/.config/scripts/installers/dragonframe-install.sh
|
||||||
|
updateProgram reaper ~/.config/scripts/installers/reaper-install.sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
dnfUpdate
|
||||||
|
aptUpdate
|
||||||
|
flatpakUpdate
|
||||||
|
manualUpdate
|
Loading…
x
Reference in New Issue
Block a user