Files
FrameAssistant/scripts/deploy-to-frame.sh
T
matzmanandClaude Opus 5.5 15623acd09 deploy-to-frame.sh: don't exit silently without a bundled package
ls fails for the pattern that matches nothing; with pipefail and set -e
the script ended without a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:28:08 +02:00

26 lines
1.4 KiB
Bash
Executable File

#!/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 <ssh-target> [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 <ssh-target> [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"