Files
a13labs.infra/ansible/files/game_station/system/steamos-select-branch
T

30 lines
658 B
Bash
Raw Normal View History

#!/bin/bash
set -euo pipefail
LOGFILE="$HOME/.local/logs/steamos-select-branch.log"
log() { echo "[$(date --iso-8601=seconds)] $*" | tee -a "$LOGFILE"; }
if [[ $# -eq 1 ]]; then
case "$1" in
"-c")
log "Current branch requested"
echo "stable"
exit 0
;;
"-l")
log "Listing available branches"
exit 0
;;
"rel")
log "Legacy branch 'rel' requested"
exit 0
;;
"stable" | "rc" | "beta" | "bc" | "preview" | "pc" | "main" | "staging")
log "Branch '$1' requested"
exit 0
;;
esac
fi
echo "Usage: steamos-select-branch <-c|-l|rel|rc|beta|bc|preview|pc|main>" 1>&2