mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-11 23:16:35 +00:00

- Move packages the provide generic functionality (such as config) from `cmd` subtree to top level. - Remove all dependencies on `cmd` subtree from top level packages. - Consolidate all code dealing with token generation and transfer to a single cohesive package.
19 lines
478 B
Go
19 lines
478 B
Go
//+build windows
|
|
|
|
package token
|
|
|
|
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
|
|
}
|