tool_resolve

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package toolresolve provides centralized binary resolution that respects both the system PATH, the well-known extra install paths (e.g. ~/.local/bin, ~/.opencode/bin), and user-configured extra paths from the terminal config.

This package never modifies the process's PATH environment variable. Instead, LookPath dynamically searches the system PATH plus all extra paths. Callers spawning subprocesses should use AppendExtraPaths to build the env for the child process.

Index

Constants

This section is empty.

Variables

View Source
var ExtraPaths = []string{
	"/usr/local/bin",
	"/usr/local/go/bin",
}

ExtraPaths are common install directories that may not be in the server process's PATH but where tools are commonly installed.

Functions

func AllExtraPaths

func AllExtraPaths() []string

func AppendExtraPaths

func AppendExtraPaths(env []string) []string

func CompareVersions

func CompareVersions(v1, v2 string) bool

func ExtractMajorVersion

func ExtractMajorVersion(version string) int

func GetFullSearchPATH

func GetFullSearchPATH() string

func IsAvailable

func IsAvailable(name string) bool

func LookPath

func LookPath(name string) (string, error)

func SetUserExtraPaths

func SetUserExtraPaths(paths []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL