Documentation
¶
Overview ¶
Package shell provides utilities for detecting and configuring user shells, particularly for managing PATH modifications during Grove onboarding.
Index ¶
- type Manager
- func (m *Manager) AddToPath(dir string) error
- func (m *Manager) Detect() (ShellType, error)
- func (m *Manager) GetPathExportLine(dir string, shell ShellType) string
- func (m *Manager) GetRcFile(shell ShellType) (string, error)
- func (m *Manager) GetRcFileName(shell ShellType) string
- func (m *Manager) GetShellName(shell ShellType) string
- func (m *Manager) PathIncludes(dir string) bool
- type ShellType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles shell configuration interactions
func (*Manager) AddToPath ¶
AddToPath adds the given directory to the user's shell PATH configuration. It detects the shell type, finds the appropriate RC file, and appends the necessary export line if the directory isn't already configured.
func (*Manager) Detect ¶
Detect returns the user's current shell type based on the SHELL environment variable
func (*Manager) GetPathExportLine ¶
GetPathExportLine returns the shell-specific line to add a directory to PATH
func (*Manager) GetRcFileName ¶
GetRcFileName returns the file name (not full path) of the RC file
func (*Manager) GetShellName ¶
GetShellName returns a human-readable name for the shell type
func (*Manager) PathIncludes ¶
PathIncludes checks if the given directory is already in the user's PATH