Skip to content

Fix install.sh crash when piped from curl#6

Merged
rorpage merged 1 commit into
mainfrom
claude/fix-install-sh-curl-pipe-crash
Jun 21, 2026
Merged

Fix install.sh crash when piped from curl#6
rorpage merged 1 commit into
mainfrom
claude/fix-install-sh-curl-pipe-crash

Conversation

@rorpage

@rorpage rorpage commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • BASH_SOURCE[0] is unbound when bash reads from stdin (the curl ... | sudo bash path), and set -euo pipefail made it an immediate fatal error
  • Even if that were worked around, the script would then fail trying to install local unit files that don't exist on the target machine
  • Fix guards BASH_SOURCE[0] with :- so SCRIPT_DIR defaults to "" when piped, then downloads unit files (game-over-man.service, game-over-man.timer) and env.example from GitHub when no local script directory is available

Mirrors the fix from rorpage/now-you-noaa#4.

Test plan

  • curl -fsSL https://raw.githubusercontent.com/rorpage/game-over-man/main/deploy/systemd/install.sh | sudo bash no longer crashes on line 14
  • sudo bash deploy/systemd/install.sh from a local clone still uses local unit files (no unnecessary downloads)
  • Source-build fallback (REPO_ROOT logic) still works from a local clone when no release binary is found

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rorpage rorpage merged commit 6195874 into main Jun 21, 2026
1 check passed
@rorpage rorpage deleted the claude/fix-install-sh-curl-pipe-crash branch June 21, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant