Skip to content

Commit

Permalink
Modified the sysinfo script to better detect various OSes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdadams committed Jul 30, 2022
1 parent 8ff6459 commit 75c5cec
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions build/sysinfo
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,31 @@ if [ "${#keys[@]}" -eq 0 ]; then
exit 0
fi

release="$(uname -r)" || panic
kernel="$(uname)" || panic
release="$(uname -r)" || panic "cannot get release name"
kernel="$(uname)" || panic "cannot get kernel name"
kernel_lc="$(tr '[:upper:]' '[:lower:]' <<< "$kernel")" || \
panic "cannot convert to lowercase"

if [ "$verbose" -ge 1 ]; then
eecho "uname $name"
eecho "uname -r $release"
eecho "system name: $name"
eecho "release name: $release"
fi

os=

case "$release" in
*[Mm]icrosoft*)
os=windows;;
esac
#case "$release" in
#*[Mm]icrosoft*)
# os=windows;;
#esac

if [ -z "$os" ]; then
case "$kernel" in
*[Ll]inux*)
case "$kernel_lc" in
linux*)
os=linux;;
ming*)
os=windows;;
darwin*)
os=macos;;
esac
fi

Expand Down

0 comments on commit 75c5cec

Please sign in to comment.