Documentation
¶
Overview ¶
Package config defines the configuration schema and helpers for wtp.
Index ¶
Constants ¶
View Source
const ( // ConfigFileName is the default filename for the wtp configuration. ConfigFileName = ".wtp.yml" // CurrentVersion represents the current configuration version written to disk. CurrentVersion = "1.0" // DefaultBaseDir is the default directory for new worktrees relative to a repository. DefaultBaseDir = "../worktrees" // HookTypeCopy identifies a hook that copies files. HookTypeCopy = "copy" // HookTypeCommand identifies a hook that executes a command. HookTypeCommand = "command" )
Variables ¶
This section is empty.
Functions ¶
func SaveConfig ¶
SaveConfig saves configuration to .git-worktree-plus.yml in the repository root
Types ¶
type Config ¶
type Config struct {
Version string `yaml:"version"`
Defaults Defaults `yaml:"defaults,omitempty"`
Hooks Hooks `yaml:"hooks,omitempty"`
}
Config represents the wtp configuration
func LoadConfig ¶
LoadConfig loads configuration from .wtp.yml in the repository root
func (*Config) ResolveWorktreePath ¶
ResolveWorktreePath resolves the full path for a worktree given a name
type Defaults ¶
type Defaults struct {
BaseDir string `yaml:"base_dir,omitempty"`
}
Defaults represents default configuration values
type Hook ¶
type Hook struct {
Type string `yaml:"type"` // "copy" or "command"
From string `yaml:"from,omitempty"`
To string `yaml:"to,omitempty"`
Command string `yaml:"command,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
WorkDir string `yaml:"work_dir,omitempty"`
}
Hook represents a single hook configuration
Click to show internal directories.
Click to hide internal directories.