2025-06-24 12:46:21 +05:30
|
|
|
package alias
|
|
|
|
|
|
2026-05-21 14:32:30 +05:30
|
|
|
import "path/filepath"
|
|
|
|
|
|
2025-06-24 12:46:21 +05:30
|
|
|
type zshShell struct{}
|
|
|
|
|
|
|
|
|
|
var _ Shell = &zshShell{}
|
|
|
|
|
|
|
|
|
|
func NewZshShell() (*zshShell, error) {
|
|
|
|
|
return &zshShell{}, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (z zshShell) Source(rcPath string) string {
|
|
|
|
|
return defaultShellSource(rcPath)
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-12 22:27:05 +05:30
|
|
|
func (z zshShell) PathExport(binDir string) string {
|
|
|
|
|
return defaultPathExport(binDir)
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-24 12:46:21 +05:30
|
|
|
func (z zshShell) Name() string {
|
|
|
|
|
return "zsh"
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-21 14:32:30 +05:30
|
|
|
// zsh reads .zshrc for every interactive shell, login or not, so one file covers it.
|
|
|
|
|
func (z zshShell) CandidateRcFiles(homeDir string) []string {
|
|
|
|
|
return []string{filepath.Join(homeDir, ".zshrc")}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (z zshShell) InstallRcFiles(homeDir string, create bool) ([]string, error) {
|
|
|
|
|
return singleRcFile(filepath.Join(homeDir, ".zshrc"), create)
|
2025-06-24 12:46:21 +05:30
|
|
|
}
|