app

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Self = "self"

	CommandUpdate    = "update"
	CommandUninstall = "uninstall"
	CommandVersion   = "version"
	CommandHelp      = "help"
)

Variables

View Source
var ErrNotSelfCommand = errors.New("not a self command")

ErrNotSelfCommand is returned when the command is not a self command.

Functions

This section is empty.

Types

type App

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

App represents the main app.

func New

func New(version string, verbose, dryRun bool) *App

New creates a new App instance.

func (*App) IsInternalCall

func (a *App) IsInternalCall() bool

IsInternalCall checks if the hook is being called internally (either via test or zsh script).

func (*App) Run

func (a *App) Run(args []string) (err error)

Run executes the main app logic.

type GitHelper

type GitHelper interface {
	GetCurrentGitRef() (string, error)
	GetRepoGitDir() (string, error)

	GitRun(subCmd string, args ...string) error
	GitOutput(subCmd string, args ...string) (string, error)
}

GitHelper provides methods for reading git references.

type SelfController added in v0.1.1

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

SelfController handles self-management commands that don't require a git repository.

func NewSelfController added in v0.1.1

func NewSelfController(buildVersion string, verbose bool) *SelfController

NewSelfController creates a new SelfController instance.

func (*SelfController) AddScript added in v0.1.1

func (sc *SelfController) AddScript(cmdName, script string) *SelfController

func (*SelfController) ExtractSelfCommand added in v0.1.1

func (sc *SelfController) ExtractSelfCommand(args []string) string

ExtractSelfCommand checks if the given arguments represent a self-management command.

func (*SelfController) HandleSelfCommand added in v0.1.1

func (sc *SelfController) HandleSelfCommand(args []string) error

HandleSelfCommand processes self-management commands and returns true if handled. Returns (handled, error) where handled indicates if the command was a self command.

Jump to

Keyboard shortcuts

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