config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config resolves wt's configuration by layering defaults, the global config, the per-repo config, and one-off env var overrides.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	WorktreeDir    string   `toml:"worktree_dir"`
	BranchPattern  string   `toml:"branch_pattern"`
	Editor         string   `toml:"editor"`
	EnvFiles       []string `toml:"env_files"`
	InstallCommand string   `toml:"install_command"`

	// NoInstall / NoCode come only from env vars (WT_NO_INSTALL /
	// WT_NO_CODE), never from a TOML file — they're one-shot run
	// overrides, not persistent settings.
	NoInstall bool
	NoCode    bool
}

Config holds wt's fully resolved settings.

WorktreeDir and BranchPattern are templates: "{repo}" and "{name}" are substituted by the caller once the repo name / worktree name are known.

func Default

func Default() Config

Default returns wt's built-in defaults, matching the original bash script's behavior.

func Load

func Load(mainDir string) (Config, error)

Load resolves the final config for a repo whose main checkout root is mainDir: defaults, then ~/.config/wt/config.toml, then <mainDir>/.wt.toml, then env var overrides. Missing files are not an error.

Jump to

Keyboard shortcuts

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