feat(distribution function): added ID_LIKE check

This commit is contained in:
Cherub
2024-06-07 17:51:02 +03:00
committed by GitHub
parent 4e92a96ede
commit 584e66af83

26
.bashrc
View File

@@ -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