mkdir ~/.config/fish if it doesn't exist yet

This commit is contained in:
David Dworken 2022-10-19 21:24:43 -07:00
parent 54679dc2db
commit 2ee050a629

View File

@ -578,6 +578,10 @@ func configureFish(homedir, binaryPath string) error {
return nil
}
// Add to fishrc
err = os.MkdirAll(path.Join(homedir, ".config/fish"), 0o744)
if err != nil {
return fmt.Errorf("failed to create fish config directory: %v", err)
}
f, err := os.OpenFile(path.Join(homedir, ".config/fish/config.fish"), os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0o644)
if err != nil {
return fmt.Errorf("failed to append to ~/.config/fish/config.fish: %v", err)