2014-02-04 20:11:26 +04:00
|
|
|
// +build windows
|
|
|
|
|
|
|
|
package open
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
2014-06-20 00:05:56 +04:00
|
|
|
"strings"
|
2015-02-21 05:38:23 +03:00
|
|
|
|
|
|
|
"github.com/getlantern/runhide"
|
2014-02-04 20:11:26 +04:00
|
|
|
)
|
|
|
|
|
2014-06-20 00:05:56 +04:00
|
|
|
func cleaninput(input string) string {
|
|
|
|
r := strings.NewReplacer("&", "^&")
|
|
|
|
return r.Replace(input)
|
|
|
|
}
|
|
|
|
|
2014-02-04 20:11:26 +04:00
|
|
|
func open(input string) *exec.Cmd {
|
2015-02-21 05:38:23 +03:00
|
|
|
return runhide.Command("cmd", "/C", "start", "", cleaninput(input))
|
2014-02-04 20:11:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
func openWith(input string, appName string) *exec.Cmd {
|
2015-02-21 05:38:23 +03:00
|
|
|
return runhide.Command("cmd", "/C", "start", "", appName, cleaninput(input))
|
2014-02-04 20:11:26 +04:00
|
|
|
}
|