lite-xl/scripts/common.sh

26 lines
495 B
Bash
Raw Permalink Normal View History

#!/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