Created
May 17, 2018 02:53
-
-
Save leozhang2018/0a6c8f54ceff1515f61ae63b9531ed01 to your computer and use it in GitHub Desktop.
shell check OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initOS() { | |
OS=$(uname | tr '[:upper:]' '[:lower:]') | |
if [ -n "$DEP_OS" ]; then | |
echo "Using DEP_OS" | |
OS="$DEP_OS" | |
fi | |
case "$OS" in | |
darwin) OS='darwin';; | |
linux) OS='linux';; | |
freebsd) OS='freebsd';; | |
mingw*) OS='windows';; | |
msys*) OS='windows';; | |
*) echo "OS ${OS} is not supported by this installation script"; exit 1;; | |
esac | |
echo "OS = $OS" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment