Documentation
¶
Overview ¶
Package workdir does best-effort detection of the "primary working directory" that a coily invocation is operating against. Subcommands
Index ¶
Constants ¶
View Source
const OverrideEnv = "COILY_PRIMARY_DIR"
OverrideEnv names the env var that forces Detect's answer.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
Result is what Detect returns. Path is always absolute and cleaned.
func DetectFrom ¶
DetectFrom is Detect parameterized on cwd, for tests and callers that already have a working directory in hand.
type Source ¶
type Source string
Source labels which signal produced the result. Callers that need to gate behavior on confidence should branch on this.
const ( // SourceEnv means $COILY_PRIMARY_DIR forced the answer. SourceEnv Source = "env" // SourceGit means the nearest ancestor with a .git entry won. SourceGit Source = "git" // SourceCoilysiren means the first path segment under // ~/projects/coilysiren/ won. SourceCoilysiren Source = "coilysiren" // SourceCWD means no other signal matched and cwd was returned verbatim. SourceCWD Source = "cwd" )
Signal labels for Result.Source, in detection-precedence order.
Click to show internal directories.
Click to hide internal directories.