Browse Source

Merge pull request #1335 from Zhboyu-BUAA/master

Fix a irrational respond about Kernel Version in Windows
dylan 5 years ago
parent
commit
ed02764ec0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      neofetch

+ 7 - 0
neofetch

@@ -1216,6 +1216,13 @@ get_kernel() {
         kernel=$(uname -v)
         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
         on)  kernel=$kernel_version ;;