ensure zsh is installed first

This commit is contained in:
2026-06-11 08:19:31 -05:00
parent 5f64e2cae4
commit 79615dd529
6 changed files with 420 additions and 2 deletions
+22
View File
@@ -387,6 +387,28 @@ func userLoginShell(uid string) string {
return ""
}
func isZshDefault() bool {
if !hasCmd("zsh") {
return false
}
zshPath := "/bin/zsh"
if r, ok := probe([]string{"which", "zsh"}, 5*time.Second); ok && r.ExitCode == 0 {
if p := strings.TrimSpace(string(r.Stdout)); p != "" {
zshPath = p
}
}
username := invokingUser()
if username == "" {
return false
}
u, err := user.Lookup(username)
if err != nil {
return false
}
current := userLoginShell(u.Uid)
return current == zshPath
}
func cloneNvimConfig() {
home, _ := os.UserHomeDir()
configDir := filepath.Join(home, ".config", "nvim")