{"modulePath":"github.com/retail-cortex/blitz","version":"v1.3.7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shellpath\n\nPackage shellpath finds programs as the user's terminal would: on the PATH an interactive login shell sets, which a GUI app or a login item doesn't inherit (Homebrew, the Google Cloud SDK, ~/.local/bin).\n\n## Functions\n\n```go\nfunc AdoptUserPath() int\n```\nAdoptUserPath gives this process the user's terminal's PATH (see Merge): a service that launchd, systemd or the tray started has the system's bare one, without the folders language servers and tools are installed in (nvm, Homebrew, ~/go/bin). It returns how many folders were added. Windows has no login shell to ask: nothing changes there.\n\n```go\nfunc Find(name string) string\n```\nFind is the program named name on this process's PATH, else on the user's terminal's (\"\" if on neither).\n\n```go\nfunc LoginShell() string\n```\nLoginShell is the user's shell ($SHELL, else the system's default).\n\n```go\nfunc LookPathIn(dirs []string, name string) string\n```\nLookPathIn is the first executable file named name in dirs (\"\" if none), as the shell would find it.\n\n```go\nfunc Merge(user, own []string) []string\n```\nMerge is the user's PATH, in their terminal's order, then this process's folders it lacks; each folder once.\n\n```go\nfunc UserPath(shell string) []string\n```\nUserPath is PATH as a new terminal has it: what an interactive login shell prints, else (it fails, or takes over 5 s) this process's PATH. A startup file that leaves a program running with the shell's output open doesn't hold it up past another second: the service's start waits for it.\n\n","path":"github.com/retail-cortex/blitz/pkg/shellpath","name":"shellpath","synopsis":"Package shellpath finds programs as the user's terminal would: on the PATH an interactive login shell sets, which a GUI app or a login item doesn't inherit (Homebrew, the Google Cloud SDK, ~/.local/bin).","isRedistributable":true}
