26 lines
495 B
Bash
26 lines
495 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
get_platform_name() {
|
|
if [[ "$OSTYPE" == "msys" ]]; then
|
|
echo "windows"
|
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
echo "macos"
|
|
elif [[ "$OSTYPE" == "linux"* || "$OSTYPE" == "freebsd"* ]]; then
|
|
echo "linux"
|
|
else
|
|
echo "UNSUPPORTED-OS"
|
|
fi
|
|
}
|
|
|
|
get_default_build_dir() {
|
|
platform=$(get_platform_name)
|
|
echo "build-$platform-$(uname -m)"
|
|
}
|
|
|
|
if [[ $(get_platform_name) == "UNSUPPORTED-OS" ]]; then
|
|
echo "Error: unknown OS type: \"$OSTYPE\""
|
|
exit 1
|
|
fi
|