Documentation
¶
Index ¶
- Constants
- func GenerateBashLoginShim(bashrcPath string) string
- func GenerateHook(shell, initPath string) string
- func HasHook(profilePath string) (bool, error)
- func InsertHook(profilePath, hookContent string) (bool, error)
- func NeedsBashLoginShim(bashProfilePath string) (bool, error)
- func RemoveHook(profilePath string) error
- type HookContent
Constants ¶
View Source
const ( // Marker patterns for hook blocks HookStartMarker = "# >>> oh-my-dot shell >>>" HookEndMarker = "# <<< oh-my-dot shell <<<" // Bash login shim markers (separate from main hook) LoginShimStartMarker = "# >>> oh-my-dot bash login >>>" LoginShimEndMarker = "# <<< oh-my-dot bash login <<<" )
Variables ¶
This section is empty.
Functions ¶
func GenerateBashLoginShim ¶
GenerateBashLoginShim generates the bash login shim for .bash_profile
func GenerateHook ¶
GenerateHook generates the hook content for a specific shell
func InsertHook ¶
InsertHook inserts the hook into a profile file (idempotent) Returns (added, error) where added=true if hook was inserted, false if already existed
func NeedsBashLoginShim ¶
NeedsBashLoginShim checks if .bash_profile needs a shim to source .bashrc
func RemoveHook ¶
RemoveHook removes the hook block from a profile file
Types ¶
type HookContent ¶
type HookContent struct {
Shell string
InitPath string // Path to the init script (e.g., "$HOME/dotfiles/omd-shells/bash/init.sh")
}
HookContent represents the content to be inserted into a shell profile
Click to show internal directories.
Click to hide internal directories.