mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Simplify WSL identification
This commit is contained in:
parent
69cde7f83c
commit
062181be4a
16
yadm
16
yadm
@ -1535,17 +1535,7 @@ function configure_repo() {
|
|||||||
|
|
||||||
function set_operating_system() {
|
function set_operating_system() {
|
||||||
|
|
||||||
# setting nocasematch to ignore case
|
if [[ "$(<"$PROC_VERSION")" =~ [Mm]icrosoft ]]; then
|
||||||
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
|
|
||||||
OPERATING_SYSTEM="WSL"
|
OPERATING_SYSTEM="WSL"
|
||||||
else
|
else
|
||||||
OPERATING_SYSTEM=$(uname -s)
|
OPERATING_SYSTEM=$(uname -s)
|
||||||
@ -1563,10 +1553,6 @@ function set_operating_system() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$unset_nocasematch" = "1" ]; then
|
|
||||||
shopt -u nocasematch &> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_awk() {
|
function set_awk() {
|
||||||
|
Loading…
Reference in New Issue
Block a user