Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
A Config contains all of the information about how files and packages are installed.
func NewConfig ¶
func NewConfig(in []byte, s EnvSelector) (c Config, err error)
NewConfig creates a config based on the contents of the YAML content `in`, and the Environment `e`. If something goes wrong parsing `in`, err is non-nil.
func (Config) CheckCmd ¶
CheckCmd returns the check command that matches the environment. If none of the environments match, nil is returned.
func (Config) DotConfig ¶
Get the DotConfig associated with a specific dot. If the dot does not exist in the config, it has all of the globally specified defaults.
func (Config) InstallCmd ¶
InstallCmd returns the install command that matches the environment. If none of the environments match, nil is returned.
func (Config) Packages ¶
Packages gets a dot `dotName`'s list of packages and their associated expansions as a slice. If the dot specified does not exist, a non-nil error will be the second returned value.
func (Config) ValidateEnv ¶
ValidateEnv checks the environment string against each validation set in the configuration. It returns non-nil if validation fails.
type DotConfig ¶
type DotConfig struct { Method string Root string DotPrefix bool Rules map[string]string Deploy [][]string // contains filtered or unexported fields }
A DotConfig holds the most specific settings that can be applied to the installation of dotfiles as specified by a dot configuration in the config. The Rules are set according to the configuration and the environment, and are exclusive to the dot it is a config of. The Method, Root, and DotPrefix are values that can be set in multiple places, with the more specific configurations taking precedence over the more general ones.
From specific to general: environment settings within the dot config, the values of the dot config itself, the environment settings of the global config, the values of the global config itself.
type EnvSelector ¶
type Package ¶
A Package represents a single key-value pair in the package map of a dot. The Name is the key of a package a dot is using. The Desc is the description of the purpose the specified package serves for the dot. The List is the list of expanded package names if the package is specified in the global package map.