mirror of
https://github.com/alda-lang/alda.git
synced 2026-02-27 18:24:13 +01:00
54 lines
821 B
Bash
Executable File
54 lines
821 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
scriptdir="$(dirname "$0")"
|
|
|
|
### BUILD ####################
|
|
|
|
pushd "$scriptdir/../" >/dev/null
|
|
|
|
build_sha="$(../bin/current-content-sha client)"
|
|
|
|
if [[ ! -d "target/$build_sha" ]]; then
|
|
bin/build
|
|
echo
|
|
echo --------------------------------------------------
|
|
echo
|
|
fi
|
|
|
|
case "$(uname -s)" in
|
|
Linux)
|
|
os=linux
|
|
;;
|
|
Darwin)
|
|
os=darwin
|
|
;;
|
|
*)
|
|
echo "uname -s returned an unexpected result: $(uname -s)"
|
|
exit 1
|
|
esac
|
|
|
|
case "$(uname -m)" in
|
|
arm64)
|
|
arch=arm64
|
|
;;
|
|
x86_64)
|
|
arch=amd64
|
|
;;
|
|
386)
|
|
arch=386
|
|
;;
|
|
*)
|
|
echo "uname -m returned an unexpected result: $(uname -m)"
|
|
exit 1
|
|
esac
|
|
|
|
popd >/dev/null
|
|
|
|
### RUN ####################
|
|
|
|
"$scriptdir/../../bin/player-on-path" \
|
|
"$scriptdir/../target/$build_sha/$os-$arch/alda" "$@"
|
|
|