Documentation
¶
Overview ¶
Package project resolves the project a working directory belongs to.
Precedence while walking upward from cwd (first match wins):
- <dir>/.acd-ctx directory (local mode, ID read from .acd-ctx/project-id)
- <dir>/.git (directory or file, covers worktrees and submodules)
- <dir>/<marker> for any configured marker (go.mod, package.json, ...)
- cwd itself when nothing matches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ReadOnly forbids writes. A local project without .acd-ctx/project-id is
// not given one; it gets the ID derived from its root path instead.
ReadOnly bool
// IDByRoot, when set, is asked for the ID already registered for a global
// project root before the path hash is used. It keeps the identity of a
// project that was moved (`project move` re-points root_path but keeps the
// ID). It lives here as a hook so this package does not import the store.
// Returning ok=false falls back to the hash of the root.
IDByRoot func(root string) (id string, ok bool)
}
Options tunes ResolveWith.
type Resolved ¶
type Resolved struct {
ID string
Root string
Storage string // "global" | "local"
Source string // "local-dir" | "git" | "marker" | "cwd"
}
Resolved describes the project found for a working directory.