mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
Expand all the guard conditionals to be as readable as possible
This commit is contained in:
@@ -5,25 +5,36 @@ abort() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Must be an Arch distro
|
# Must be an Arch distro
|
||||||
[[ -f /etc/arch-release ]] || abort "Vanilla Arch"
|
if [[ ! -f /etc/arch-release ]]; then
|
||||||
|
abort "Vanilla Arch"
|
||||||
|
fi
|
||||||
|
|
||||||
# Must not be an Arch derivative distro
|
# Must not be an Arch derivative distro
|
||||||
for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do
|
for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do
|
||||||
[[ -f "$marker" ]] && abort "Vanilla Arch"
|
if [[ -f "$marker" ]]; then
|
||||||
|
abort "Vanilla Arch"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Must not be running as root
|
# Must not be running as root
|
||||||
[ "$EUID" -eq 0 ] && abort "Running as root (not user)"
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
abort "Running as root (not user)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Must be x86 only to fully work
|
# Must be x86 only to fully work
|
||||||
[ "$(uname -m)" != "x86_64" ] && abort "x86_64 CPU"
|
if [ "$(uname -m)" != "x86_64" ]; then
|
||||||
|
abort "x86_64 CPU"
|
||||||
|
fi
|
||||||
|
|
||||||
# Must have secure boot disabled
|
# Must have secure boot disabled
|
||||||
bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled' && abort "Secure Boot disabled"
|
if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then
|
||||||
|
abort "Secure Boot disabled"
|
||||||
|
fi
|
||||||
|
|
||||||
# Must not have Gnome or KDE already install
|
# Must not have Gnome or KDE already install
|
||||||
pacman -Qe gnome-shell &>/dev/null && abort "Fresh + Vanilla Arch"
|
if pacman -Qe gnome-shell &>/dev/null || pacman -Qe plasma-desktop &>/dev/null; then
|
||||||
pacman -Qe plasma-desktop &>/dev/null && abort "Fresh + Vanilla Arch"
|
abort "Fresh + Vanilla Arch"
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleared all guards
|
# Cleared all guards
|
||||||
echo "Guards: OK"
|
echo "Guards: OK"
|
||||||
|
|||||||
Reference in New Issue
Block a user