mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
30 lines
581 B
Go
30 lines
581 B
Go
// Copyright (C) 2014 The Syncthing Authors.
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
// +build !windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"runtime"
|
|
"syscall"
|
|
)
|
|
|
|
func openURL(url string) error {
|
|
switch runtime.GOOS {
|
|
case "darwin":
|
|
return exec.Command("open", url).Run()
|
|
|
|
default:
|
|
cmd := exec.Command("xdg-open", url)
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
|
Setpgid: true,
|
|
}
|
|
return cmd.Run()
|
|
}
|
|
}
|