Skip to content

feat: make installed binary name overridable (default flashduty)#22

Merged
ysyneu merged 3 commits into
mainfrom
feat/fduty-install-name
May 29, 2026
Merged

feat: make installed binary name overridable (default flashduty)#22
ysyneu merged 3 commits into
mainfrom
feat/fduty-install-name

Conversation

@ysyneu
Copy link
Copy Markdown
Contributor

@ysyneu ysyneu commented May 29, 2026

Summary

  • install.sh now honours an INSTALLED_NAME env override, defaulting to flashduty (INSTALLED_NAME="${INSTALLED_NAME:-flashduty}"); the post-install verify hint reflects the actual name.
  • Makefile BINARY_NAME := flashdutyBINARY_NAME ?= flashduty, so make build BINARY_NAME=fduty produces a fduty binary.
  • Public default is unchanged — no override → still flashduty. The Go module, cobra Use: string, help text, repo name, and FLASHDUTY_* env contract are untouched.

Why

fc-safari bakes a private copy of this CLI into its AI-SRE sandbox. A user who self-installs the public flashduty-cli would collide with that copy (overwrite / version skew). Installing our copy as fduty removes the collision. This PR adds the override knob; the consumer side (sandbox image bake + BYOC fallback) is in the fc-safari PR.

Test plan

  • make build (no override) → produces bin/flashduty (default unchanged)
  • BINARY_NAME=fduty make build → produces bin/fduty, runs, version works (cobra Use: still flashduty)
  • INSTALLED_NAME=fduty curl … install.sh | sh installs as fduty (exercised by fc-safari BYOC fallback after merge)

ysyneu added 3 commits May 29, 2026 10:04
install.sh: INSTALLED_NAME defaults to "flashduty" but honours a
caller-supplied INSTALLED_NAME env var so we can install our bundled
copy as "fduty" without shadowing a user's own flashduty installation.
All uses of the installed name (mv target, chmod, PATH message, verify
hint) already reference the variable — only the hardcoded default
literal needed updating.

Makefile: BINARY_NAME switches from := (immediate, non-overridable) to
?= so `make build BINARY_NAME=fduty` produces bin/fduty; default
behaviour (make build) is unchanged.

Public identity (cobra Use: string, help text, FLASHDUTY_* env vars,
Go module, repo name) is untouched.
The release workflow uploaded binaries + releases/latest but not the install
scripts; those were mirrored only by install-scripts.yml on install.sh/.ps1
changes. Re-upload them here so a release always ships a current installer on
the CDN even when the scripts themselves didn't change.
The copy served from the CDN now defaults MIRROR_URL to the CDN (injected at
upload time via the new MIRROR_PUBLIC_URL secret), so `curl <cdn>/install.sh |
sh` pulls binaries from the CDN without the caller passing MIRROR_URL. The repo
/ GitHub copy stays generic (defaults to GitHub). A grep guard fails the job if
the default line ever stops matching, so the injection can't silently no-op.
@ysyneu ysyneu merged commit 056b20b into main May 29, 2026
14 checks passed
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