diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-04-04 16:23:21 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-04-04 16:23:21 +0200 |
commit | 913566adaa414d764dc2b041d47a9206ac7c6d2e (patch) | |
tree | bb8faa0e49627e19e81e1975a80c606dbd7ba433 /lib/main.bash | |
parent | fcc5996afbbbc5717323452cc4448a9316346c48 (diff) |
Add install support for Archlinux
Diffstat (limited to 'lib/main.bash')
-rw-r--r-- | lib/main.bash | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/main.bash b/lib/main.bash index 42164bc..c535ba5 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -206,7 +206,8 @@ discover_system() { RSTAR_PLATFORM["arch"]="$(discover_system_arch)" RSTAR_PLATFORM["version"]="$(discover_system_version)" - if [[ ${RSTAR_PLATFORM[os]} == "linux" ]] + # When on a Linux-using OS, check for the specific distribution in use. + if [[ ${RSTAR_PLATFORM[os]} == *"linux"* ]] then RSTAR_PLATFORM["distro"]="$(discover_system_distro)" fi @@ -225,7 +226,14 @@ discover_system_distro() { return fi - awk -F= '$1 == "NAME" {print tolower($2);q}' /etc/*release + crit "No /etc/os-release found. Are you sure you're on a sane GNU+Linux distribution?" + + if command -v pacman > /dev/null + then + warn "Found pacman, assuming Archlinux as distro." + printf "%s" "archlinux" + return + fi } discover_system_version() { |