Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBinaryPath ¶
GetBinaryPath returns the path to the termonaut binary
func GetCurrentWorkingDir ¶
func GetCurrentWorkingDir() string
GetCurrentWorkingDir returns the current working directory
func GetTerminalPID ¶
func GetTerminalPID() int
GetTerminalPID returns the current terminal process ID
func ValidateShellInstallation ¶
func ValidateShellInstallation() error
ValidateShellInstallation checks if the shell integration is working
Types ¶
type ConfigBackup ¶ added in v0.9.4
ConfigBackup represents a backup of the configuration file
func (*ConfigBackup) CleanupBackup ¶ added in v0.9.4
func (backup *ConfigBackup) CleanupBackup() error
CleanupBackup removes the backup file
func (*ConfigBackup) RestoreFromBackup ¶ added in v0.9.4
func (backup *ConfigBackup) RestoreFromBackup() error
RestoreFromBackup restores the configuration file from backup
type HookInstaller ¶
type HookInstaller struct {
// contains filtered or unexported fields
}
HookInstaller handles shell hook installation
func NewHookInstaller ¶
func NewHookInstaller(binaryPath string) (*HookInstaller, error)
NewHookInstaller creates a new hook installer
func (*HookInstaller) GetShellType ¶
func (h *HookInstaller) GetShellType() ShellType
GetShellType returns the detected shell type
func (*HookInstaller) Install ¶
func (h *HookInstaller) Install() error
Install installs the shell hook
func (*HookInstaller) InstallWithForce ¶
func (h *HookInstaller) InstallWithForce(force bool) error
InstallWithForce installs the shell hook with force option
func (*HookInstaller) IsInstalled ¶
func (h *HookInstaller) IsInstalled() (bool, error)
IsInstalled checks if the hook is already installed
func (*HookInstaller) Uninstall ¶
func (h *HookInstaller) Uninstall() error
Uninstall removes the shell hook
type SafeConfigManager ¶ added in v0.9.4
type SafeConfigManager struct {
// contains filtered or unexported fields
}
SafeConfigManager handles safe modification of shell configuration files
func NewSafeConfigManager ¶ added in v0.9.4
func NewSafeConfigManager(configFile string, shellType ShellType) *SafeConfigManager
NewSafeConfigManager creates a new safe configuration manager
func (*SafeConfigManager) AddTermonautBlock ¶ added in v0.9.4
func (scm *SafeConfigManager) AddTermonautBlock(content string) error
AddTermonautBlock safely adds the Termonaut configuration block
func (*SafeConfigManager) CreateBackup ¶ added in v0.9.4
func (scm *SafeConfigManager) CreateBackup() (*ConfigBackup, error)
CreateBackup creates a timestamped backup of the configuration file
func (*SafeConfigManager) GetTermonautBlock ¶ added in v0.9.4
func (scm *SafeConfigManager) GetTermonautBlock() ([]string, int, int, error)
GetTermonautBlock extracts the Termonaut configuration block from the file
func (*SafeConfigManager) RemoveTermonautBlock ¶ added in v0.9.4
func (scm *SafeConfigManager) RemoveTermonautBlock() error
RemoveTermonautBlock safely removes the Termonaut configuration block