From 062181be4a76bb14bff684435b280e0cfccd4fe1 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Mon, 3 Feb 2020 08:27:54 -0600 Subject: [PATCH] Simplify WSL identification --- yadm | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/yadm b/yadm index faaf02e..f869f3b 100755 --- a/yadm +++ b/yadm @@ -1535,17 +1535,7 @@ 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) - if [[ "$proc_version" =~ Microsoft ]]; then + if [[ "$(<"$PROC_VERSION")" =~ [Mm]icrosoft ]]; then OPERATING_SYSTEM="WSL" else OPERATING_SYSTEM=$(uname -s) @@ -1563,10 +1553,6 @@ function set_operating_system() { ;; esac - if [ "$unset_nocasematch" = "1" ]; then - shopt -u nocasematch &> /dev/null - fi - } function set_awk() {