Browse Source

judge whether wsl system (bahs on windows)

linshuboy 7 years ago
parent
commit
29363b9e76
1 changed files with 4 additions and 0 deletions
  1. 4 0
      include/check_os.sh

+ 4 - 0
include/check_os.sh

@@ -48,6 +48,10 @@ else
   kill -9 $$
 fi
 
+if [ "$(uname -r | awk -F- '{print $3}' 2>/dev/null)" == "Microsoft" ]; then
+  Wsl=true
+fi
+
 if [ "$(getconf WORD_BIT)" == "32" ] && [ "$(getconf LONG_BIT)" == "64" ]; then
   OS_BIT=64
   SYS_BIG_FLAG=x64 #jdk