config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = ".wm.yaml"

Variables

This section is empty.

Functions

func FindConfig

func FindConfig(dir string) (string, error)

FindConfig searches for .wm.yaml starting from dir and walking up

func SaveConfig

func SaveConfig(path string, cfg *Config) error

SaveConfig writes a Config to a .wm.yaml file

Types

type Config

type Config struct {
	Version  int            `yaml:"version"`
	Worktree WorktreeConfig `yaml:"worktree"`
	Scan     ScanConfig     `yaml:"scan"`
	Sync     []SyncItem     `yaml:"sync"`
	Tasks    TasksConfig    `yaml:"tasks"`
}

Config represents the .wm.yaml file structure

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads and parses a .wm.yaml file

func NewConfig

func NewConfig() *Config

NewConfig returns a Config with default values

type PostInstallConfig

type PostInstallConfig struct {
	Mode     string   `yaml:"mode"`
	Commands []string `yaml:"commands"`
	Notify   string   `yaml:"notify,omitempty"`
}

type ScanConfig

type ScanConfig struct {
	IgnoreDirs []string `yaml:"ignore_dirs"`
}

type SyncItem

type SyncItem struct {
	Src  string `yaml:"src"`
	Dst  string `yaml:"dst,omitempty"`
	Mode string `yaml:"mode,omitempty"` // "copy" (default) or "symlink"
	When string `yaml:"when,omitempty"` // "always" (default) or "missing"
}

SyncItem can be a string path or an object with src/dst/mode/when

type TasksConfig

type TasksConfig struct {
	PostInstall PostInstallConfig `yaml:"post_install"`
}

type WorktreeConfig

type WorktreeConfig struct {
	BaseDir string `yaml:"base_dir"`
}

Jump to

Keyboard shortcuts

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