toolbox

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindToolsDir added in v1.0.41

func FindToolsDir() (string, error)

FindToolsDir identifies the path to the local directory containing Thelma's bundled tools, and returning an error if it can't be found. It does this by trying to expand "../../tools" relative to $0 (the currently-running Thelma executable) Note that this location is correct:

  • for installed Thelma instances running out of ~/.thelma/releases/current (thelma is located in ~/.thelma/releases/current/bin, tools are in ~/.thelma/releases/current/tools/bin)
  • for locally-build Thelma compiled with `make build` (thelma is compiled to ./output/bin, third-party tools are downloaded ./output/tools/bin)
  • for unpacked Thelma releases (release archives have thelma at ./bin/ and tools at ./tools/bin)

Types

type ToolFinder added in v1.0.41

type ToolFinder interface {
	// ExpandPath if `command` is the name of a tool that exists in the toolbox directory,
	// such as "kubectl", "helm", "argocd", return the fully-qualified path to that tool
	// within the toolbox directory.
	// (eg. "/Users/blah/.thelma/releases/v1.2.3/tools/bin/helm")
	// else, return the name unchanged (eg. "curl")
	ExpandPath(command string) string
}

ToolFinder exists to help shell.Runner instances resolve fully-qualified paths to Thelma's bundled tools

func NewToolFinder added in v1.0.41

func NewToolFinder() (ToolFinder, error)

NewToolFinder calls FindToolsDir to identify the location of Thelma's bundled tools and returns a new ToolFinder rooted at the tools dir's `bin` directory

func NewToolFinderWithDir added in v1.0.41

func NewToolFinderWithDir(executableDir string) (ToolFinder, error)

NewToolFinderWithDir FOR USE IN TESTS ONLY construct a new ToolFinder rooted at a custom tools directory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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