mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-18 18:07:12 +00:00
Distro: Prefer /etc/os-release, break on successful source
This commit is contained in:
5
neofetch
5
neofetch
@@ -131,6 +131,7 @@ get_distro() {
|
|||||||
esac
|
esac
|
||||||
ascii_distro="Windows 10"
|
ascii_distro="Windows 10"
|
||||||
|
|
||||||
|
# TODO: Install Red Star OS and check if this is really needed.
|
||||||
elif [[ -f "/etc/redstar-release" ]]; then
|
elif [[ -f "/etc/redstar-release" ]]; then
|
||||||
case "$distro_shorthand" in
|
case "$distro_shorthand" in
|
||||||
"on" | "tiny") distro="Red Star OS" ;;
|
"on" | "tiny") distro="Red Star OS" ;;
|
||||||
@@ -160,8 +161,8 @@ get_distro() {
|
|||||||
|
|
||||||
else
|
else
|
||||||
# Source the os-release file
|
# Source the os-release file
|
||||||
for file in /etc/*ease /usr/lib/*ease; do
|
for file in /etc/os-release /etc/*ease /usr/lib/*ease; do
|
||||||
source "$file"
|
source "$file" && break
|
||||||
done
|
done
|
||||||
|
|
||||||
# The 3rd line down matches the fold marker syntax. {{{
|
# The 3rd line down matches the fold marker syntax. {{{
|
||||||
|
|||||||
Reference in New Issue
Block a user