From 3e4bb8c57d1679684a9b30790e570294c8e2b0d6 Mon Sep 17 00:00:00 2001 From: PorridgePi Date: Wed, 28 Sep 2022 19:35:23 +0800 Subject: [PATCH] zshrc: feat: Add distro type determination --- .zshrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.zshrc b/.zshrc index 5edabcf..ff2acf9 100644 --- a/.zshrc +++ b/.zshrc @@ -31,6 +31,17 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then DISTRO=$(uname -s) VER=$(uname -r) fi + + if command -v dpkg &> /dev/null; then + # Debian-based + DISTRO_TYPE=debian + elif command -v yum &> /dev/null; then + # RPM-based + DISTRO_TYPE=rpm + elif command -v pacman &> /dev/null; then + # Arch-based + DISTRO_TYPE=arc + fi elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS OSNAME=macOS