#!/bin/bash set -euo pipefail if [[ $# -lt 1 || $# -gt 2 || -z $1 || $1 == -* || ( $# -eq 2 && $2 != --e2e ) ]]; then echo "Usage: $0 [--e2e]" >&2 exit 2 fi cd "$(dirname "$0")/.." host=$1 runner=Scripts/test.sh if [[ ${2:-} == --e2e ]]; then runner=Scripts/test-e2e.sh fi source Scripts/remote-sync.sh remote_dir=$(remote_sync "$host") # The directory is validated above before it is inserted into the remote command. # shellcheck disable=SC2029 ssh "$host" "cd ~/parcel-ci/$remote_dir && $runner"