Skip to main content

Module install

Module install 

Source
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§

InstallMethod
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.