config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ToolDir is a template string for the directory where managed tools are installed.
	// Defaults to "{{RootDir}}/.tool". Can be overridden before Makefile() is called.
	ToolDir = "{{RootDir}}/.tool"

	// RootDir is a template string for the project root directory.
	// Defaults to "{{GitRoot}}" which resolves to the directory containing .git.
	RootDir = "{{GitRoot}}"

	// TmpDir specifies an alternate temporary directory. If empty, uses the system
	// default temp directory. Useful for CI environments with specific temp paths.
	TmpDir = ""

	// OS is the target operating system (runtime.GOOS). Used in template rendering
	// and tool downloads.
	OS = runtime.GOOS

	// Arch is the target architecture (runtime.GOARCH). Used in template rendering
	// and tool downloads.
	Arch = runtime.GOARCH

	// Debug enables debug logging and additional diagnostics like periodic stack traces.
	// Set via DEBUG=true or RUNNER_DEBUG=1 environment variables.
	Debug = false

	// Trace enables even more verbose logging than Debug. Implies Debug=true.
	// Set via TRACE=true environment variable.
	Trace = false

	// CI indicates running in a continuous integration environment.
	// Set via CI=true environment variable (automatically set by most CI systems).
	CI = false

	// Windows is true when running on Windows (runtime.GOOS == "windows").
	Windows = runtime.GOOS == "windows"

	// Cleanup controls whether temporary files are deleted. Automatically disabled
	// when Debug or CI is true to aid in debugging.
	Cleanup = true
)

Functions

func DoExit added in v0.1.0

func DoExit()

DoExit executes all registered exit handlers in reverse registration order. This is automatically called by Makefile() via defer. Thread-safe.

func Env

func Env(key, defaultValue string) string

Env returns the value of an environment variable, or defaultValue if not set. Unlike os.Getenv, this distinguishes between "not set" and "set to empty string".

func OnExit added in v0.1.0

func OnExit(fn func())

OnExit registers a cleanup function to run when DoExit is called. Functions are executed in reverse order (LIFO), like defer statements. Panics if fn is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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