config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = ".wt.toml"

Variables

This section is empty.

Functions

func SampleConfig

func SampleConfig() string

SampleConfig returns a sample configuration file content.

Types

type Config

type Config struct {
	BaseBranch       string   `toml:"base_branch"`
	WorktreeDir      string   `toml:"worktree_dir"`
	PreprocessScript string   `toml:"preprocess_script"`
	CopyPatterns     []string `toml:"copy_patterns"`
	PostHooks        []Hook   `toml:"post_hooks"`
}

func DefaultConfig

func DefaultConfig() *Config

func Load

func Load() (*Config, error)

Load finds and parses .wt.toml from the current directory or parent directories. Returns default config if no config file is found.

func LoadFromDir

func LoadFromDir(dir string) (*Config, error)

LoadFromDir loads config from a specific directory.

type Hook

type Hook struct {
	Name     string `toml:"name"`
	Run      string `toml:"run"`
	IfExists string `toml:"if_exists,omitempty"`
}

Jump to

Keyboard shortcuts

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