Skip to content

Commit edf6df8

Browse files
committed
feat: make installed binary name overridable via env/make var
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.
1 parent 28098b2 commit edf6df8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build configuration
2-
BINARY_NAME := flashduty
2+
BINARY_NAME ?= flashduty
33
BUILD_DIR := bin
44
GOLANGCI_LINT_VERSION := v2.2.1
55
GOLANGCI_LINT := $(BUILD_DIR)/golangci-lint

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e
1515

1616
REPO="flashcatcloud/flashduty-cli"
1717
BINARY="flashduty-cli"
18-
INSTALLED_NAME="flashduty"
18+
INSTALLED_NAME="${INSTALLED_NAME:-flashduty}"
1919
INSTALL_DIR="${FLASHDUTY_INSTALL_DIR:-/usr/local/bin}"
2020

2121
# When set, all release downloads are fetched from this prefix instead of github.com.
@@ -188,7 +188,7 @@ main() {
188188
info " export PATH=\"${INSTALL_DIR}:\$PATH\"" ;;
189189
esac
190190

191-
info "Run 'flashduty version' to verify"
191+
info "Run '${INSTALLED_NAME} version' to verify"
192192
}
193193

194194
main

0 commit comments

Comments
 (0)