Skip to content

Commit

Permalink
Escape & for windows cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-debricked committed Sep 17, 2024
1 parent 52370c0 commit b2a8cef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/auth/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (awh AuthWebHelper) openBrowserCmd(runtimeOS, url string) *exec.Cmd {
switch runtimeOS {
case "windows":
cmd = "cmd"
url = "\"" + url + "\"" // Windows does not like "&"
args = []string{"/c", "start"}
case "darwin":
cmd = "open"
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/callback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestOpenBrowserCmd(t *testing.T) {
},
{
runtimeOS: "windows",
expectedCmd: exec.Command("cmd", "/c", "start", "url"),
expectedCmd: exec.Command("cmd", "/c", "start", "\"url\""),
},
}

Expand Down

0 comments on commit b2a8cef

Please sign in to comment.