Documentation
¶
Index ¶
- Constants
- func AddFeatureToShell(repoPath, shellName, featureName string, strategy string, onCommand []string, ...) error
- func CleanupShellDirectory(repoPath, shellName string) error
- func DetectCurrentShell() (string, error)
- func DisableFeature(repoPath, shellName, featureName string) error
- func EnableFeature(repoPath, shellName, featureName string) error
- func EnableFeatureWithOptions(repoPath, shellName, featureName, strategy string, onCommand []string) error
- func GenerateInitScript(repoPath, shellName string) (string, error)
- func GetFeatureFilePath(repoPath, shellName, featureName string) (string, error)
- func GetFeaturesDirectory(repoPath, shellName string) string
- func GetInitScriptPath(repoPath, shellName string) (string, error)
- func GetLocalManifestPath(repoPath, shellName string) string
- func GetManifestPath(repoPath, shellName string) string
- func GetShellDirectory(repoPath, shellName string) string
- func InitializeShellDirectory(repoPath, shellName string) error
- func IsShellExecutableAvailable(shellName string) bool
- func IsShellSupported(shellName string) bool
- func ListShellsWithFeatures(repoPath string) ([]string, error)
- func LocalManifestFileName() string
- func NeedsCleanup(repoPath, shellName string) (bool, error)
- func RefreshFeatureTemplate(repoPath, shellName, featureName string) error
- func RegenerateAllInitScripts(repoPath string) error
- func RegenerateInitScript(repoPath, shellName string) error
- func RemoveFeatureFromShell(repoPath, shellName, featureName string) error
- func ResolveProfilePath(shellConfig ShellConfig) (string, error)
- func ShellDirectoryExists(repoPath, shellName string) bool
- func SupportedShells() map[string]ShellConfig
- type FeaturesByStrategy
- type ShellConfig
Constants ¶
const HelpersFileContent = `` /* 208-byte string literal not displayed */
HelpersFileContent is the template content for the helpers.sh file
Variables ¶
This section is empty.
Functions ¶
func AddFeatureToShell ¶
func AddFeatureToShell(repoPath, shellName, featureName string, strategy string, onCommand []string, disabled bool, options map[string]any) error
AddFeatureToShell adds a feature to a specific shell
func CleanupShellDirectory ¶
CleanupShellDirectory removes a shell directory and its contents
func DetectCurrentShell ¶
DetectCurrentShell attempts to detect the current shell
func DisableFeature ¶
DisableFeature disables a feature
func EnableFeature ¶
EnableFeature enables a disabled feature
func EnableFeatureWithOptions ¶ added in v0.0.30
func EnableFeatureWithOptions(repoPath, shellName, featureName, strategy string, onCommand []string) error
EnableFeatureWithOptions enables a disabled feature and optionally updates its configuration
func GenerateInitScript ¶
GenerateInitScript generates a complete init script for a shell Supports eager, defer, and on-command loading strategies (Phase 5) Supports local overrides via enabled.local.json (Phase 6)
func GetFeatureFilePath ¶
GetFeatureFilePath returns the path to a specific feature file
func GetFeaturesDirectory ¶
GetFeaturesDirectory returns the path to the features directory for a shell
func GetInitScriptPath ¶
GetInitScriptPath returns the path to the init script for a shell
func GetLocalManifestPath ¶
GetLocalManifestPath returns the path to enabled.local.json for a shell
func GetManifestPath ¶
GetManifestPath returns the path to enabled.json for a shell
func GetShellDirectory ¶
GetShellDirectory returns the path to the shell directory within omd-shells
func InitializeShellDirectory ¶
InitializeShellDirectory creates the directory structure for a shell
func IsShellExecutableAvailable ¶ added in v0.0.47
IsShellExecutableAvailable reports whether the current environment can resolve a shell executable.
func IsShellSupported ¶
IsShellSupported checks if a shell is supported
func ListShellsWithFeatures ¶
ListShellsWithFeatures returns a list of shells that have been initialized
func LocalManifestFileName ¶ added in v0.0.41
func LocalManifestFileName() string
LocalManifestFileName returns the filename used for device-local shell overrides.
func NeedsCleanup ¶
NeedsCleanup checks if a shell directory should be cleaned up (no features left)
func RefreshFeatureTemplate ¶ added in v0.0.53
RefreshFeatureTemplate rewrites an installed feature file from the catalog template.
func RegenerateAllInitScripts ¶
TODO: Hook up somehow so the user can use it RegenerateAllInitScripts regenerates init scripts for all initialized shells
func RegenerateInitScript ¶
RegenerateInitScript regenerates the init script for a shell This should be called after any manifest changes
func RemoveFeatureFromShell ¶
RemoveFeatureFromShell removes a feature from a shell
func ResolveProfilePath ¶
func ResolveProfilePath(shellConfig ShellConfig) (string, error)
ResolveProfilePath resolves the profile path for a shell, expanding ~ to home directory
func ShellDirectoryExists ¶
ShellDirectoryExists checks if a shell directory has been initialized
func SupportedShells ¶
func SupportedShells() map[string]ShellConfig
SupportedShells returns a map of all supported shells with their configurations
Types ¶
type FeaturesByStrategy ¶
type FeaturesByStrategy struct {
Eager []string
Defer []string
OnCommand map[string][]string // feature name -> trigger commands
}
FeaturesByStrategy organizes features by their loading strategy
type ShellConfig ¶
type ShellConfig struct {
Name string // Shell name (e.g., "bash", "zsh", "fish", "powershell", "posix")
ProfilePath string // Path to the shell's profile file (e.g., "~/.bashrc")
Extension string // File extension for feature files (e.g., ".sh", ".zsh", ".fish")
InitScript string // Name of the init script (e.g., "init.sh", "init.zsh")
}
ShellConfig represents the configuration for a specific shell
func GetShellConfig ¶
func GetShellConfig(shellName string) (ShellConfig, bool)
GetShellConfig returns the configuration for a specific shell