Documentation
¶
Overview ¶
Package cwdpath confines paths to the working directory (--cwd).
TinyAgent reads and writes its project state only inside --cwd. Resolve turns a path from config or the environment into one inside cwd, or refuses it: a path that leaves cwd through "..", an absolute path elsewhere, or a symlink that resolves outside cwd. Only cwd itself and the path below it are looked at.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrOutside = errors.New("path must stay inside --cwd")
ErrOutside marks a path that was refused because it would leave --cwd.
Functions ¶
func Resolve ¶
Resolve returns p (relative to cwd, or absolute) as an absolute path inside cwd. It refuses, wrapping ErrOutside, a path with a ".." element, an absolute path outside cwd, cwd itself, and one whose existing part resolves through a symlink to somewhere outside cwd. The path need not exist. The returned path keeps cwd as given (made absolute).
Types ¶
This section is empty.