mirror of
https://github.com/TheLocehiliosan/yadm
synced 2026-03-02 03:49:29 +00:00
Improve identification of WSL (#196)
Ignore case when searching for Microsoft inside /proc/version.
This commit is contained in:
11
yadm
11
yadm
@@ -1524,6 +1524,13 @@ function configure_repo() {
|
||||
|
||||
function set_operating_system() {
|
||||
|
||||
# setting nocasematch to ignore case
|
||||
local unset_nocasematch
|
||||
if ! shopt nocasematch &> /dev/null; then
|
||||
unset_nocasematch=1
|
||||
fi
|
||||
shopt -s nocasematch &> /dev/null
|
||||
|
||||
# special detection of WSL (windows subsystem for linux)
|
||||
local proc_version
|
||||
proc_version=$(cat "$PROC_VERSION" 2>/dev/null)
|
||||
@@ -1545,6 +1552,10 @@ function set_operating_system() {
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$unset_nocasematch" = "1" ]; then
|
||||
shopt -u nocasematch &> /dev/null
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function set_awk() {
|
||||
|
||||
Reference in New Issue
Block a user