Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ParentFS ¶
type ParentFS interface { fs.FS // Full path for the current dir. Path() string // Base path for the current dir (similar to path.Base(this.Path())) Base() string // True unless the current dir is a root dir. HasParent() bool // Resolves parent dir if HasParent() == true Parent() ParentFS // Like LookPath from os/exec but local executable paths are // interpreted relative to current FS. LookPath(string) (string, error) }
File system and os interface. Helps test executor detection. Extends fs.FS with ability to explore parent folders, search for executables in PATH.
func TestFS ¶
Implements parentFS for testing. Unlike the prod implementation, path operations do not vary by OS but are unix-y.
files is an in-memory filesystem
workdir is a relative path to the current working dir in the in-memory filesystem
globalPath maps short executable names to full paths to emulate PATH resolution in LookPath.
Click to show internal directories.
Click to hide internal directories.