Documentation
¶
Index ¶
- func ExpandPath(path string) (string, error)
- func LinkPackages(opts LinkOptions, logger *logging.Logger) error
- func RunScripts(opts SetupOptions, logger *logging.Logger) error
- func UnlinkPackage(pkgName string, cfg *Config, logger *logging.Logger) error
- func UnlinkPackages(opts UnlinkOptions, logger *logging.Logger) error
- type ConditionSet
- type Config
- func (c *Config) GetBackupPath(packageName, relativePath string) (string, error)
- func (c *Config) GetEffectiveConfig(packageName, relativePath string) *FileConfig
- func (c *Config) GetSourcePath(packageName string) (string, error)
- func (c *Config) GetTargetPath(packageName, relativePath string) (string, error)
- func (c *Config) IsDryRun(packageName, relativePath string) bool
- func (c *Config) MatchesConditions(conditionSet *ConditionSet, logger *logging.Logger) bool
- func (c *Config) ShouldBeVerbose(packageName, relativePath string) bool
- func (c *Config) ShouldForce(packageName, relativePath string) bool
- func (c *Config) ShouldIgnorePackage(relPath string) bool
- type FileConfig
- type LinkOptions
- type PackageConfig
- type SetupOptions
- type UnlinkOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath expands the ~ in paths to the absolute home directory path.
func LinkPackages ¶
func LinkPackages(opts LinkOptions, logger *logging.Logger) error
LinkPackages creates symlinks for all specified packages
func RunScripts ¶
func RunScripts(opts SetupOptions, logger *logging.Logger) error
RunScripts runs the specified setup scripts
func UnlinkPackage ¶
UnlinkPackage removes symlinks for a single package
func UnlinkPackages ¶
func UnlinkPackages(opts UnlinkOptions, logger *logging.Logger) error
UnlinkPackages removes symlinks for all specified packages
Types ¶
type ConditionSet ¶
type Config ¶
type Config struct {
SourceDir string `yaml:"source_dir"`
TargetDir string `yaml:"target_dir"`
BackupDir string `yaml:"backup_dir"`
Force bool `yaml:"force"`
Verbose bool `yaml:"verbose"`
DryRun bool `yaml:"dry_run"`
Packages map[string]*PackageConfig `yaml:"link_overrides"`
IgnorePackages []string `yaml:"ignore_packages"`
}
func LoadConfig ¶
LoadConfig loads configuration from the specified file If the file doesn't exist, returns default config
func (*Config) GetBackupPath ¶
GetBackupPath returns the path where a file should be backed up
func (*Config) GetEffectiveConfig ¶
func (c *Config) GetEffectiveConfig(packageName, relativePath string) *FileConfig
GetEffectiveConfig returns the effective configuration for a specific file by merging global, package-level, and file-specific settings
func (*Config) GetSourcePath ¶
GetSourcePath returns the full path for a source package
func (*Config) GetTargetPath ¶
GetTargetPath returns the full path for a target in the target directory
func (*Config) MatchesConditions ¶
func (c *Config) MatchesConditions(conditionSet *ConditionSet, logger *logging.Logger) bool
MatchesConditions checks if the current environment matches the given conditions
func (*Config) ShouldBeVerbose ¶
ShouldBeVerbose returns whether verbose output should be enabled for a specific file
func (*Config) ShouldForce ¶
ShouldForce returns whether force mode is enabled for a specific file
func (*Config) ShouldIgnorePackage ¶
ShouldIgnorePackage checks if a package or a file should be skipped from Symlinking
type FileConfig ¶
type LinkOptions ¶
type PackageConfig ¶
type PackageConfig struct {
SourceDir string `yaml:"source_dir"`
TargetDir string `yaml:"target_dir"`
BackupDir string `yaml:"backup_dir"`
Force *bool `yaml:"force"`
Verbose *bool `yaml:"verbose"`
DryRun bool `yaml:"dry_run"`
Conditions *ConditionSet `yaml:"conditions"`
Files map[string]*FileConfig `yaml:"file_overrides"`
}
type SetupOptions ¶
type SetupOptions struct {
// Config is the application configuration
Config *Config
// Scripts is the list of script names to run
Scripts []string
}
SetupOptions holds the options for setup operations