Skip to content

Commit 87b5c59

Browse files
committed
move homedir into sprintf
1 parent 8ea1965 commit 87b5c59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/shellexec/shellexec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr st
182182
} else if wsl.IsPowershell(shellPath) {
183183
// powershell is weird about quoted path executables and requires an ampersand first
184184
shellPath = "& " + shellPath
185-
subShellOpts = append(subShellOpts, "-ExecutionPolicy", "Bypass", "-NoExit", "-File", homeDir+fmt.Sprintf("/.waveterm/%s/wavepwsh.ps1", shellutil.PwshIntegrationDir))
185+
subShellOpts = append(subShellOpts, "-ExecutionPolicy", "Bypass", "-NoExit", "-File", fmt.Sprintf("%s/.waveterm/%s/wavepwsh.ps1", homeDir, shellutil.PwshIntegrationDir))
186186
} else {
187187
if cmdOpts.Login {
188188
subShellOpts = append(subShellOpts, "-l")
@@ -315,7 +315,7 @@ func StartRemoteShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts Comm
315315
} else if remote.IsPowershell(shellPath) {
316316
// powershell is weird about quoted path executables and requires an ampersand first
317317
shellPath = "& " + shellPath
318-
shellOpts = append(shellOpts, "-ExecutionPolicy", "Bypass", "-NoExit", "-File", homeDir+fmt.Sprintf("/.waveterm/%s/wavepwsh.ps1", shellutil.PwshIntegrationDir))
318+
shellOpts = append(shellOpts, "-ExecutionPolicy", "Bypass", "-NoExit", "-File", fmt.Sprintf("%s/.waveterm/%s/wavepwsh.ps1", homeDir, shellutil.PwshIntegrationDir))
319319
} else {
320320
if cmdOpts.Login {
321321
shellOpts = append(shellOpts, "-l")

0 commit comments

Comments
 (0)