Merge pull request #1335 from Zhboyu-BUAA/master

Fix a irrational respond about Kernel Version in Windows
This commit is contained in:
dylan 2019-10-30 10:32:00 +00:00 committed by GitHub
commit ed02764ec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1216,6 +1216,13 @@ get_kernel() {
kernel=$(uname -v) kernel=$(uname -v)
return return
} }
# In Windows 'uname' may return the info of GNUenv thus use wmic for OS kernel
[[ "$os" == Windows ]] && {
kernel=$(wmic os get Version)
kernel="${kernel/Version}"
return
}
case $kernel_shorthand in case $kernel_shorthand in
on) kernel=$kernel_version ;; on) kernel=$kernel_version ;;