#!/usr/bin/env bash

set -e

scriptdir="$(dirname "$0")"

### BUILD ####################

pushd "$scriptdir/../" >/dev/null

build_sha="$(../bin/current-content-sha player)"

if [[ ! -d "target/$build_sha" ]]; then
  bin/build
  echo
  echo --------------------------------------------------
  echo
fi

popd >/dev/null

### RUN ####################

"$scriptdir/../target/$build_sha/non-windows/alda-player" "$@"

