ghcup-metadata/.github/workflows/common.sh

31 lines
465 B
Bash
Raw Normal View History

2023-02-17 15:45:19 +00:00
#!/bin/bash
if [ "${RUNNER_OS}" = "Windows" ] ; then
ext=".exe"
else
ext=''
fi
echo_color() {
local color="$1"
local msg="$2"
echo -e "\033[${color}m${msg}\033[0m"
}
error() { echo_color "${RED}" "$1"; }
warn() { echo_color "${LT_BROWN}" "$1"; }
info() { echo_color "${LT_BLUE}" "$1"; }
fail() { error "error: $1"; exit 1; }
mktempdir() {
case "$(uname -s)" in
"Darwin"|"darwin")
mktemp -d -t hls_ci.XXXXXXX
;;
*)
mktemp -d
;;
esac
}