MCPcopy Create free account
hub / github.com/docker/docker-agent / ToolsDir

Function ToolsDir

pkg/toolinstall/paths.go:13–18  ·  view source on GitHub ↗

ToolsDir returns the base directory for installed tools. Checks DOCKER_AGENT_TOOLS_DIR env var, defaults to ~/.cagent/tools/

()

Source from the content-addressed store, hash-verified

11// ToolsDir returns the base directory for installed tools.
12// Checks DOCKER_AGENT_TOOLS_DIR env var, defaults to ~/.cagent/tools/
13func ToolsDir() string {
14 if dir := os.Getenv("DOCKER_AGENT_TOOLS_DIR"); dir != "" {
15 return filepath.Clean(dir)
16 }
17 return filepath.Join(paths.GetDataDir(), "tools")
18}
19
20// BinDir returns the directory where tool binaries/symlinks are placed.
21// This is ToolsDir()/bin/

Callers 6

BinDirFunction · 0.85
PackageDirFunction · 0.85
RegistryDirFunction · 0.85
TestEnsureSymlinkFunction · 0.85
TestToolsDir_DefaultFunction · 0.85
TestToolsDir_EnvOverrideFunction · 0.85

Calls 1

GetDataDirFunction · 0.92

Tested by 3

TestEnsureSymlinkFunction · 0.68
TestToolsDir_DefaultFunction · 0.68
TestToolsDir_EnvOverrideFunction · 0.68