Expand description
How this binary was installed, and therefore which command updates it.
codewhale update replaces the running executable in place. That is the
right thing for a binary the user downloaded from GitHub Releases, and the
wrong thing for one a package manager owns: overwriting Homebrew’s Cellar
binary or npm’s node_modules payload leaves the manager’s metadata
describing a version that is no longer on disk, and the next
brew upgrade / npm install -g silently reverts the user.
So before we tell anyone to run anything, we work out who owns the file. Detection is path-based (plus an escape-hatch env var) because the install method is a property of where the binary lives, which is knowable offline, in a test, and without asking a package manager anything.
Enums§
- Install
Method - The package manager (if any) that owns the running executable.
Constants§
- INSTALL_
METHOD_ ENV - Environment variable that overrides install-method detection.
Functions§
- current_
install_ method - Detect the install method for the currently running executable.