Documentation
¶
Overview ¶
Package toolpath finds the external programs a sync runs (git, gh, and npm for its fallback) when the process's PATH does not hold them.
A server started from Finder, launchd or a desktop shortcut gets a minimal PATH with none of Homebrew, nvm, Volta or fnm on it, so a tool that is installed is still "not found" by exec.LookPath alone. That is how a tabler sync failed with "npm not on PATH" on a machine with npm installed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Dirs = defaultDirs
Dirs lists the usual install directories, searched after PATH, newest node first where a version manager keeps several. A var so tests can replace it.
Functions ¶
func IsExecutable ¶
IsExecutable reports whether p is a file this process could run.
func LookPath ¶
LookPath is exec.LookPath, then Dirs. It returns the path and whether it came from PATH.
func NewestFirst ¶
NewestFirst globs pattern and orders the matches by the version in their path, newest first, so v22 beats v9.
Types ¶
This section is empty.