toolpath

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func IsExecutable(p string) bool

IsExecutable reports whether p is a file this process could run.

func LookPath

func LookPath(name string) (string, bool, error)

LookPath is exec.LookPath, then Dirs. It returns the path and whether it came from PATH.

func Names

func Names(name string) []string

Names is the file names name has on this OS.

func NewestFirst

func NewestFirst(pattern string) []string

NewestFirst globs pattern and orders the matches by the version in their path, newest first, so v22 beats v9.

Types

This section is empty.

Jump to

Keyboard shortcuts

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