Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSetup = stderrors.New("not setup")
ErrNotSetup is returned when a dotfile has not been setup to be managed by dot.
var ErrSetup = stderrors.New("already setup with a different registry")
ErrSetup is returned when dot has already been setup with a different registry.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the API for managing dotfiles with dot.
func (*Client) Apply ¶
Apply will copy dotfile sources from a registry to their destination. Optionally, a list of dotfile names can be provided to only apply specific dotfiles. If no names are provided, all dotfiles will be applied.
By default, Apply will check if the dotfile destination file has been manually modified. If a modification is detected, the dotfile will not be applied and an error will be returned. If force is set to true, this check is skipped and the dotfile is always applied.
func (*Client) Setup ¶
Setup will setup dot to manage dotfiles. If the dotfile destination already exists, a backup of it will be made, so the original version can be restored. Setup will only setup dotfiles that have not been previously setup. This means it can be called multiple times to setup additional dotfiles.
If registryDir is different than the one used by dot, Setup will return ErrSetup unless force is true, in which case it will overwrite the current registry dir.
type Debugger ¶
type Debugger interface {
Debugf(format string, args ...interface{})
}
Debugger wraps the Debugf method and represents any type that can write debug messages.
type Option ¶
type Option func(*Client)
Option is a function that takes a Client instance and applies a configuration to it.
func WithDebugger ¶
WithDebugger sets a Debugger that should be used by the client to write debug messages.
func WithHomeDir ¶
WithHomeDir sets the directory that the client should use when the home directory is needed.