powerups

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package powerups implements various power-up types that process matched files and generate actions. Power-ups are responsible for determining what operations should be performed on matched files.

Index

Constants

View Source
const (
	// BinPowerUpName is the unique name for the bin power-up
	BinPowerUpName = "bin"

	// BinPowerUpPriority is the priority for bin operations
	BinPowerUpPriority = 90
)
View Source
const (
	SymlinkPowerUpName     = "symlink"
	SymlinkPowerUpPriority = 100
)
View Source
const (
	// TemplatePowerUpName is the unique name for the template power-up
	TemplatePowerUpName = "template"

	// TemplatePowerUpPriority is the priority for template operations
	TemplatePowerUpPriority = 70
)
View Source
const (
	// BrewfilePowerUpName is the unique name for the Brewfile power-up
	BrewfilePowerUpName = "brewfile"
)
View Source
const (
	// InstallScriptPowerUpName is the unique name for the install script power-up
	InstallScriptPowerUpName = "install_script"
)
View Source
const (
	ShellAddPathPowerUpName = "shell_add_path"
)
View Source
const (
	ShellProfilePowerUpName = "shell_profile"
)

Variables

This section is empty.

Functions

func GetBrewfileSentinelPath

func GetBrewfileSentinelPath(pack string) string

GetSentinelPath returns the path to the sentinel file for a pack

func GetInstallSentinelPath

func GetInstallSentinelPath(pack string) string

GetSentinelPath returns the path to the sentinel file for a pack

func NewBrewfilePowerUp

func NewBrewfilePowerUp() types.PowerUp

NewBrewfilePowerUp creates a new instance of the Brewfile power-up

func NewInstallScriptPowerUp

func NewInstallScriptPowerUp() types.PowerUp

NewInstallScriptPowerUp creates a new instance of the install script power-up

func NewShellAddPathPowerUp

func NewShellAddPathPowerUp() types.PowerUp

NewShellAddPathPowerUp creates a new instance of the ShellAddPathPowerUp

func NewShellProfilePowerUp

func NewShellProfilePowerUp() types.PowerUp

NewShellProfilePowerUp creates a new instance of the ShellProfilePowerUp

func RegisterBrewfilePowerUpFactory

func RegisterBrewfilePowerUpFactory()

RegisterBrewfilePowerUpFactory registers the Brewfile power-up factory

func RegisterInstallScriptPowerUpFactory

func RegisterInstallScriptPowerUpFactory()

RegisterInstallScriptPowerUpFactory registers the install script power-up factory

Types

type BinPowerUp

type BinPowerUp struct {
	// contains filtered or unexported fields
}

BinPowerUp handles executable files by creating symlinks in ~/bin

func NewBinPowerUp

func NewBinPowerUp() *BinPowerUp

NewBinPowerUp creates a new BinPowerUp

func (*BinPowerUp) Description

func (p *BinPowerUp) Description() string

Description returns a human-readable description

func (*BinPowerUp) Name

func (p *BinPowerUp) Name() string

Name returns the unique name of this power-up

func (*BinPowerUp) Process

func (p *BinPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

Process takes executable files and creates symlink actions to ~/bin

func (*BinPowerUp) RunMode

func (p *BinPowerUp) RunMode() types.RunMode

RunMode returns when this power-up should run

func (*BinPowerUp) ValidateOptions

func (p *BinPowerUp) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid

type BrewfilePowerUp

type BrewfilePowerUp struct{}

BrewfilePowerUp processes Brewfiles to install packages via Homebrew

func (*BrewfilePowerUp) Description

func (p *BrewfilePowerUp) Description() string

Description returns a human-readable description of what this power-up does

func (*BrewfilePowerUp) Name

func (p *BrewfilePowerUp) Name() string

Name returns the unique name of this power-up

func (*BrewfilePowerUp) Process

func (p *BrewfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

Process takes Brewfile matches and generates brew actions

func (*BrewfilePowerUp) RunMode

func (p *BrewfilePowerUp) RunMode() types.RunMode

RunMode returns whether this power-up runs once or many times

func (*BrewfilePowerUp) ValidateOptions

func (p *BrewfilePowerUp) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this power-up

type InstallScriptPowerUp

type InstallScriptPowerUp struct{}

InstallScriptPowerUp runs install.sh scripts

func (*InstallScriptPowerUp) Description

func (p *InstallScriptPowerUp) Description() string

Description returns a human-readable description of what this power-up does

func (*InstallScriptPowerUp) Name

func (p *InstallScriptPowerUp) Name() string

Name returns the unique name of this power-up

func (*InstallScriptPowerUp) Process

func (p *InstallScriptPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

Process takes install script matches and generates install actions

func (*InstallScriptPowerUp) RunMode

func (p *InstallScriptPowerUp) RunMode() types.RunMode

RunMode returns whether this power-up runs once or many times

func (*InstallScriptPowerUp) ValidateOptions

func (p *InstallScriptPowerUp) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this power-up

type ShellAddPathPowerUp

type ShellAddPathPowerUp struct{}

ShellAddPathPowerUp manages adding directories to the PATH

func (*ShellAddPathPowerUp) Description

func (p *ShellAddPathPowerUp) Description() string

func (*ShellAddPathPowerUp) Name

func (p *ShellAddPathPowerUp) Name() string

func (*ShellAddPathPowerUp) Process

func (p *ShellAddPathPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

func (*ShellAddPathPowerUp) RunMode

func (p *ShellAddPathPowerUp) RunMode() types.RunMode

func (*ShellAddPathPowerUp) ValidateOptions

func (p *ShellAddPathPowerUp) ValidateOptions(options map[string]interface{}) error

type ShellProfilePowerUp

type ShellProfilePowerUp struct{}

ShellProfilePowerUp manages shell profile modifications

func (*ShellProfilePowerUp) Description

func (p *ShellProfilePowerUp) Description() string

func (*ShellProfilePowerUp) Name

func (p *ShellProfilePowerUp) Name() string

func (*ShellProfilePowerUp) Process

func (p *ShellProfilePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

func (*ShellProfilePowerUp) RunMode

func (p *ShellProfilePowerUp) RunMode() types.RunMode

func (*ShellProfilePowerUp) ValidateOptions

func (p *ShellProfilePowerUp) ValidateOptions(options map[string]interface{}) error

type SymlinkPowerUp

type SymlinkPowerUp struct {
	// contains filtered or unexported fields
}

SymlinkPowerUp creates symbolic links from matched files to target locations

func NewSymlinkPowerUp

func NewSymlinkPowerUp() *SymlinkPowerUp

NewSymlinkPowerUp creates a new SymlinkPowerUp with default target as user home

func (*SymlinkPowerUp) Description

func (p *SymlinkPowerUp) Description() string

Description returns a human-readable description of what this power-up does

func (*SymlinkPowerUp) Name

func (p *SymlinkPowerUp) Name() string

Name returns the unique name of this power-up

func (*SymlinkPowerUp) Process

func (p *SymlinkPowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

Process takes a group of trigger matches and generates symlink actions

func (*SymlinkPowerUp) RunMode

func (p *SymlinkPowerUp) RunMode() types.RunMode

RunMode returns whether this power-up runs once or many times

func (*SymlinkPowerUp) ValidateOptions

func (p *SymlinkPowerUp) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid for this power-up

type TemplatePowerUp

type TemplatePowerUp struct {
	// contains filtered or unexported fields
}

TemplatePowerUp processes template files and expands variables

func NewTemplatePowerUp

func NewTemplatePowerUp() *TemplatePowerUp

NewTemplatePowerUp creates a new TemplatePowerUp

func (*TemplatePowerUp) Description

func (p *TemplatePowerUp) Description() string

Description returns a human-readable description

func (*TemplatePowerUp) Name

func (p *TemplatePowerUp) Name() string

Name returns the unique name of this power-up

func (*TemplatePowerUp) Process

func (p *TemplatePowerUp) Process(matches []types.TriggerMatch) ([]types.Action, error)

Process takes template files and generates processed file actions

func (*TemplatePowerUp) RunMode

func (p *TemplatePowerUp) RunMode() types.RunMode

RunMode returns when this power-up should run

func (*TemplatePowerUp) ValidateOptions

func (p *TemplatePowerUp) ValidateOptions(options map[string]interface{}) error

ValidateOptions checks if the provided options are valid

Jump to

Keyboard shortcuts

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