Simplify WSL identification

This commit is contained in:
Ross Smith II 2020-02-03 08:27:54 -06:00 committed by Tim Byrne
parent 69cde7f83c
commit 062181be4a
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 1 additions and 15 deletions

16
yadm
View File

@ -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() {