Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func installers() (i []installer) {
break
}
}
if f := rcFile(".zshrc"); f != "" {
if f := zshrcPath(); f != "" {
i = append(i, zsh{f})
}
if d := fishConfigDir(); d != "" {
Expand All @@ -74,6 +74,16 @@ func installers() (i []installer) {
return
}

func zshrcPath() string {
Comment thread
posener marked this conversation as resolved.
if zDotDir := os.Getenv("ZDOTDIR"); zDotDir != "" {
f := filepath.Join(zDotDir, ".zshrc")
if info, err := os.Stat(f); err != nil || !info.IsDir() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err == nil && !info.IsDir()?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is completely wrong. Updated it

return f
}
}
return rcFile(".zshrc")
}

func fishConfigDir() string {
configDir := filepath.Join(getConfigHomePath(), "fish")
if configDir == "" {
Expand Down