updated os_detection.sh

pull/2/head
Hari Sekhon 5 years ago
parent 4fa27b6e3a
commit 3d016867ea

@ -15,14 +15,29 @@
[ -n "${OS_DETECTION_RUN:-}" ] && return
uname="$(uname)"
get_os(){
if [ -z "$operating_system" ] ||
! [[ "$operating_system" =~ ^(Linux|Darwin)$ ]]; then
operating_system="$(uname -s)"
fi
}
isLinux(){
get_os
[ "$operating_system" = Linux ]
}
isMac(){
get_os
[ "$operating_system" = Darwin ]
}
if [ "$uname" = Linux ]; then
if isLinux; then
export LINUX=1
if [ -n "${DEVSHELL_PROJECT_ID:-}" ]; then
export GOOGLE_CLOUD_SHELL=1
fi
elif [ "$uname" = Darwin ]; then
elif isMac; then
export APPLE=1
export OSX=1
fi

Loading…
Cancel
Save