Documentation ¶
Index ¶
- func AddHooks(loadHooks func(profile string) Hooks, command *cobra.Command) *cobra.Command
- func AddProfile(profile string) error
- func AvailableProfiles() []string
- func CurrentProfile() string
- func Dir() string
- func ExpandFilePath(path string) string
- func GetDefaultConfigDir() string
- func GetProfileByName(name string) string
- func Init()
- func ModuleDir() string
- func ProfileDir() string
- func ProfileName(path string) string
- func RunCommands(commands []string)
- func SetCurrentProfile(profile string) error
- func XDG() string
- type Config
- type DFMYml
- type Hooks
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProfile ¶
func AvailableProfiles ¶
func AvailableProfiles() []string
func CurrentProfile ¶
func CurrentProfile() string
func ExpandFilePath ¶
ExpandFilePath does bash-esque expansions on a filepath
func GetDefaultConfigDir ¶
func GetDefaultConfigDir() string
GetDefaultConfigDir will return the default location to store profiles which is $XDG_CONFIG_HOME/dfm or $HOME/.config/dfm
func GetProfileByName ¶
func ModuleDir ¶
func ModuleDir() string
ModuleDir will return the module directory for the given profile
func ProfileDir ¶
func ProfileDir() string
ProfileDir will return the config.Dir joined with profiles.
func ProfileName ¶
ProfileName returns the name of the profile from it's full path
func RunCommands ¶
func RunCommands(commands []string)
RunCommands will run the given slice of strings each as their own command
func SetCurrentProfile ¶
SetCurrentProfile will save the config.json
Types ¶
type Config ¶
type Config struct { // CurrentProfileName is the currently loaded profile. CurrentProfileName string `yaml:"current_profile"` }
type DFMYml ¶
type DFMYml struct { Hooks Hooks `yaml:"hooks"` Mappings filemap.Mappings `yaml:"mappings"` Modules []Module `yaml:"modules"` SyncModules bool `yaml:"always_sync_modules"` }
DFMYml is used for extending and configuring DFM. It is the .dfm.yml file found in the root of a profile.
func LoadDotDFM ¶
LoadDotDFM will load the hooks file for the given Profile
func (DFMYml) PostLinkModules ¶
Return modules which should be linked before the parent profile
func (DFMYml) PreLinkModules ¶
Return modules which should be linked before the parent profile
type Module ¶
type Module struct { Repo string `yaml:"repo"` Branch string `yaml:"branch,omitempty"` Link string `yaml:"link,omitempty"` UserName string `yaml"name"` UserLocation string `yaml:"location,omitempty"` Mappings filemap.Mappings `yaml:"mappings,omitempty"` PullOnly bool `yaml:"pull_only"` }
Module is a profile module, it will be linked as it if was a top level profile.