Documentation
¶
Overview ¶
Package install answers one question about the running binary: how it got here, and therefore what would replace it with a newer one.
It exists as its own package because more than one thing needs the answer. `outplane update` runs the command, `outplane update --check` prints it, and anything reporting on the local setup can name the channel. Deciding it in a command handler would mean deciding it again in the next one.
Nothing here installs anything. Detect reports; the caller runs.
Index ¶
Constants ¶
const ( // NpmPackage is the wrapper package. The platform binaries it pulls in are // @outplane/cli-<os>-<arch>, but nobody installs those directly. NpmPackage = "outplane" ScriptURL = "https://outplane.com/install.sh" )
The two supported channels, named once.
Every other mention of them, in help text, in error messages and in the documentation, should read from here. Two copies of an install command is how a release ends up telling half its users to run something that no longer works.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Method ¶
type Method struct {
// Name is how a person refers to the channel: "npm", "the install script".
Name string
// Path is the resolved location of the running binary. Reported so that a
// surprising answer can be checked rather than argued with.
Path string
// Command is the argv that updates this installation, or nil when this is
// not an installation the CLI knows how to replace.
Command []string
// Display is the same command as a person would type it. It differs from
// Command for the install script, whose argv wraps a shell pipeline and
// reads badly when joined.
Display string
// Reason explains why Command is nil, in one sentence, and is empty
// otherwise.
Reason string
}
Method is how this binary was installed, and what would update it.
func Detect ¶
func Detect() Method
Detect classifies the running binary.
Symlinks are resolved first, and that is not a detail: npm puts a link in the global bin directory pointing into node_modules, so the unresolved path looks like an ordinary /usr/local/bin install and would be updated the wrong way.