mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
build tags fix
This commit is contained in:
parent
9a671bf898
commit
5668f28f46
2 changed files with 30 additions and 23 deletions
|
@ -8,7 +8,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -176,28 +175,6 @@ func run(w webview.WebView) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func run_command(command string) []byte {
|
|
||||||
args := []string{"-json", command}
|
|
||||||
cmd := exec.Command(riv_ctrl_path, args...)
|
|
||||||
out, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
//log.Fatalf("cmd.Run() failed with %s\n", err)
|
|
||||||
return []byte(err.Error())
|
|
||||||
}
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
func run_command_with_arg(command string, arg string) []byte {
|
|
||||||
args := []string{"-json", command, arg}
|
|
||||||
cmd := exec.Command(riv_ctrl_path, args...)
|
|
||||||
out, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
//log.Fatalf("command failed: %s\n", riv_ctrl_path+" "+strings.Join(args, " "))
|
|
||||||
return []byte(err.Error())
|
|
||||||
}
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
func add_peers(uri string) {
|
func add_peers(uri string) {
|
||||||
run_command_with_arg("addpeers", "uri="+uri)
|
run_command_with_arg("addpeers", "uri="+uri)
|
||||||
}
|
}
|
||||||
|
|
30
contrib/ui/mesh-ui/webview_other.go
Normal file
30
contrib/ui/mesh-ui/webview_other.go
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//go:build !windows
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os/exec"
|
||||||
|
)
|
||||||
|
|
||||||
|
func run_command(command string) []byte {
|
||||||
|
args := []string{"-json", command}
|
||||||
|
cmd := exec.Command(riv_ctrl_path, args...)
|
||||||
|
out, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
//log.Fatalf("cmd.Run() failed with %s\n", err)
|
||||||
|
return []byte(err.Error())
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
func run_command_with_arg(command string, arg string) []byte {
|
||||||
|
args := []string{"-json", command, arg}
|
||||||
|
cmd := exec.Command(riv_ctrl_path, args...)
|
||||||
|
out, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
//log.Fatalf("command failed: %s\n", riv_ctrl_path+" "+strings.Join(args, " "))
|
||||||
|
return []byte(err.Error())
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue