1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-05 17:10:24 +08:00
Files
terasu-cloudflared/cmd/cloudflared/shell/launch_browser_windows.go
2019-09-24 18:27:37 +00:00

19 lines
478 B
Go

//+build windows
package shell
import (
"fmt"
"os/exec"
"syscall"
)
func getBrowserCmd(url string) *exec.Cmd {
cmd := exec.Command("cmd")
// CmdLine is only defined when compiling for windows.
// Empty string is the cmd proc "Title". Needs to be included because the start command will interpret the first
// quoted string as that field and we want to quote the URL.
cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf(`/c start "" "%s"`, url)}
return cmd
}