#!/usr/bin/env bash # Copies a release package to the Steam Frame over SSH and installs it there (registers # it with SteamVR and starts it; an existing installation in the same place is updated). # SteamVR must be running on the Frame. # # scripts/deploy-to-frame.sh [package-dir] [remote-dir] # e.g. scripts/deploy-to-frame.sh steamos@frame # # package-dir defaults to the newest dist/*-linux-arm64 package (scripts/package-release.sh); # remote-dir defaults to the package's base name in the remote home directory. set -euo pipefail target="${1:?usage: $0 [package-dir] [remote-dir]}" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # ls fails when one of the patterns matches nothing (e.g. no bundled package); with # pipefail that would end the script silently. package="${2:-$(ls -dt "$root"/dist/*-linux-arm64 "$root"/dist/*-linux-arm64-bundled 2>/dev/null | head -1 || true)}" [[ -n "$package" && -x "$package/install.sh" ]] || { echo "No release package found (run scripts/package-release.sh first)" >&2; exit 1; } # Without the version: updates go to the same place and replace the old version. remote="${3:-$(basename "$package" | sed -E 's/-[0-9][0-9.]*-linux-arm64(-bundled)?$//')}" rsync -a --delete --exclude logs/ "$package/" "$target:$remote/" ssh "$target" "\$HOME/$remote/install.sh" echo "Installed $(basename "$package") to $target:~/$remote"