#!/usr/bin/env bash # Copies the newest package (package-release.sh) to the Steam Frame over SSH # and runs its install.sh there (registers with SteamVR and starts it; an # existing installation in the same place is updated). SteamVR must be running # on the Frame. Adapted from the vrdashboard template. # # build_scripts/steamframe/deploy-to-frame.sh [package-dir] [remote-dir] # e.g. build_scripts/steamframe/deploy-to-frame.sh steamos@frame # # remote-dir defaults to "AdvancedSettings" in the remote home directory. set -euo pipefail target="${1:?usage: $0 [package-dir] [remote-dir]}" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" package="${2:-$(ls -dt "$root"/dist/AdvancedSettings-*-linux-arm64 2>/dev/null | head -1)}" [[ -n "$package" && -x "$package/install.sh" ]] || { echo "No package found (run build_scripts/steamframe/package-release.sh first)" >&2; exit 1; } # Without the version: updates go to the same place and replace the old one. remote="${3:-AdvancedSettings}" # Keep the log of earlier runs on the Frame. rsync -a --delete --exclude AdvancedSettings.log "$package/" "$target:$remote/" ssh "$target" "\$HOME/$remote/install.sh" echo "Installed $(basename "$package") to $target:~/$remote"