hooks

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func GenerateBashLoginShim(bashrcPath string) string

GenerateBashLoginShim generates the bash login shim for .bash_profile

func GenerateHook

func GenerateHook(shell, initPath string) string

GenerateHook generates the hook content for a specific shell

func HasHook

func HasHook(profilePath string) (bool, error)

HasHook checks if a profile file already contains the hook

func InsertHook

func InsertHook(profilePath, hookContent string) (bool, error)

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

func NeedsBashLoginShim(bashProfilePath string) (bool, error)

NeedsBashLoginShim checks if .bash_profile needs a shim to source .bashrc

func RemoveHook

func RemoveHook(profilePath string) error

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

Jump to

Keyboard shortcuts

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