Skip to content

Commit 4b5ef79

Browse files
author
David May
committed
Fix powershell path difference between windows and mac
1 parent 7e4381c commit 4b5ef79

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/config/user.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
_ "embed"
55
"fmt"
66
"os"
7+
"runtime"
78
"slices"
89
"strconv"
910
"strings"
@@ -136,7 +137,11 @@ func (user *userStruct) getShellRcFile() string {
136137

137138
if user.pterm == "pwsh" {
138139
// return os.Getenv("PROFILE") // For some reason this doesn't work (pwsh> $PROFILE)
139-
return utils.Join(utils.GetUserHomeDir(), ".config", "powershell", "Microsoft.PowerShell_profile.ps1")
140+
if runtime.GOOS == "windows" {
141+
return utils.Join(utils.GetUserHomeDir(), "Documents", "WindowsPowerShell", "Microsoft.PowerShell_profile.ps1")
142+
} else {
143+
return utils.Join(utils.GetUserHomeDir(), ".config", "powershell", "Microsoft.PowerShell_profile.ps1")
144+
}
140145
}
141146

142147
return ""

0 commit comments

Comments
 (0)