#!/bin/bash set -euo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) TESTER_DIR=${SCRIPT_DIR}/tester DATA_DIR=${TESTER_DIR}/data MP3_DIR=${SCRIPT_DIR}/../mp3 # Set automatically arch="`uname -m`" platform= verbose=true fail_fast=false bin_dir=$(realpath ${SCRIPT_DIR}/..) __check_platform() { if test -z "$platform" -a \( "$arch" = "arm64" -o "$arch" = "aarch64" \); then platform=linux/arm64 elif test -z "$platform"; then platform=linux/amd64 fi } do_help() { cat <&2 exit 1 fi ;; -x|--x86-64) shift platform=linux/amd64 ;; --bin-dir) bin_dir="$2" shift shift ;; --help) shift do_help exit 0 ;; *) POSITIONAL+=("$1") shift esac done set -- "${POSITIONAL[@]}" __check_platform # Default subcommand if [[ $# == 0 ]]; then do_all exit 0 fi # Subcommands case $1 in help) do_help exit 0 ;; server) shift do_server $@ ;; control) shift do_control $@ ;; milestone) shift do_milestone $@ ;; all) shift do_all $@ ;; *) echo "Unrecognized command $1" exit 1 ;; esac } main $@