From 584e66af833409ffb9050435231a0fb3347bc6ed Mon Sep 17 00:00:00 2001 From: Cherub <110939979+Cherub26@users.noreply.github.com> Date: Fri, 7 Jun 2024 17:51:02 +0300 Subject: [PATCH] feat(distribution function): added ID_LIKE check --- .bashrc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index cec3a70..377d4cc 100644 --- a/.bashrc +++ b/.bashrc @@ -366,7 +366,31 @@ distribution () dtype="slackware" ;; *) - # If ID is not recognized, keep dtype as unknown + # Check ID_LIKE only if dtype is still unknown + if [ -n "$ID_LIKE" ]; then + case $ID_LIKE in + *fedora*|*rhel*|*centos*) + dtype="redhat" + ;; + *sles*|*opensuse*) + dtype="suse" + ;; + *ubuntu*|*debian*) + dtype="debian" + ;; + *gentoo*) + dtype="gentoo" + ;; + *arch*) + dtype="arch" + ;; + *slackware*) + dtype="slackware" + ;; + esac + fi + + # If ID or ID_LIKE is not recognized, keep dtype as unknown ;; esac fi