Skip to content

Commit

Permalink
Open URLs with "open" when on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Jun 10, 2024
1 parent 89fee19 commit 67199ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engine/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package engine

import (
"os/exec"
"runtime"
"strings"

log "github.com/sirupsen/logrus"
Expand All @@ -24,6 +25,10 @@ func (ac *Config) OpenURL(host, cPort string, httpsPrefix bool) {
sb.WriteString(cPort)
url := sb.String()

if ac.openExecutable == "" && runtime.GOOS == "darwin" {
ac.openExecutable = "open"
}

// Open the URL
log.Info("Running: " + ac.openExecutable + " " + url)
cmd := exec.Command(ac.openExecutable, url)
Expand Down

0 comments on commit 67199ed

Please sign in to comment.