Connecting Mizu to the application (#317)

This commit is contained in:
RoyUP9
2021-10-07 17:28:28 +03:00
committed by GitHub
parent 82d603c0fd
commit 14b616a856
15 changed files with 286 additions and 35 deletions

View File

@@ -4,9 +4,7 @@ import (
"context"
"fmt"
"os"
"os/exec"
"os/signal"
"runtime"
"syscall"
"github.com/up9inc/mizu/cli/config"
@@ -49,21 +47,3 @@ func waitForFinish(ctx context.Context, cancel context.CancelFunc) {
}
}
func openBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
default:
err = fmt.Errorf("unsupported platform")
}
if err != nil {
logger.Log.Errorf("error while opening browser, %v", err)
}
}