add guard clause to enforce sudo user

This commit is contained in:
Triston Armstrong 2024-11-11 00:45:38 -05:00
parent d7c4c9e63b
commit 488b05e827

View File

@ -1,9 +1,17 @@
#!/bin/bash
# TODO should be applicable to other package managers (dnf, apt, ..)
# v--- this is for potential future ideas
# flatpak uninstall $(flatpak list --columns=application | grep -i turtle)
main(){
if [[ "$(whoami)" != "root" ]];then
bash ./error.sh "Must be root (current: $USER)";
exit 1;
fi
_update_pac
bash ./dots.sh;
bash ./cli.sh;
@ -13,8 +21,8 @@ main(){
}
_update_pac(){
sudo pacman -Fy --noconfirm
sudo pacman -Syu --noconfirm
pacman -Fy --noconfirm
pacman -Syu --noconfirm
}