feat: make installed binary name overridable (default flashduty)#22
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install.shnow honours anINSTALLED_NAMEenv override, defaulting toflashduty(INSTALLED_NAME="${INSTALLED_NAME:-flashduty}"); the post-install verify hint reflects the actual name.MakefileBINARY_NAME := flashduty→BINARY_NAME ?= flashduty, somake build BINARY_NAME=fdutyproduces afdutybinary.flashduty. The Go module, cobraUse:string, help text, repo name, andFLASHDUTY_*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-cliwould collide with that copy (overwrite / version skew). Installing our copy asfdutyremoves 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) → producesbin/flashduty(default unchanged)BINARY_NAME=fduty make build→ producesbin/fduty, runs,versionworks (cobraUse:stillflashduty)INSTALLED_NAME=fduty curl … install.sh | shinstalls asfduty(exercised by fc-safari BYOC fallback after merge)