mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v2] Put mac specific calls behind build tag
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
|
||||
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Info holds information about the current operating system,
|
||||
@@ -107,14 +105,3 @@ func checkDocker() *packagemanager.Dependancy {
|
||||
External: false,
|
||||
}
|
||||
}
|
||||
|
||||
// IsAppleSilicon returns true if the app is running on Apple Silicon
|
||||
// Credit: https://www.yellowduck.be/posts/detecting-apple-silicon-via-go/
|
||||
func IsAppleSilicon() bool {
|
||||
r, err := syscall.Sysctl("sysctl.proc_translated")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return r == "\x00\x00\x00" || r == "\x01\x00\x00"
|
||||
}
|
||||
|
||||
@@ -44,3 +44,14 @@ func (i *Info) discover() error {
|
||||
i.Dependencies = append(i.Dependencies, checkUPX())
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsAppleSilicon returns true if the app is running on Apple Silicon
|
||||
// Credit: https://www.yellowduck.be/posts/detecting-apple-silicon-via-go/
|
||||
func IsAppleSilicon() bool {
|
||||
r, err := syscall.Sysctl("sysctl.proc_translated")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return r == "\x00\x00\x00" || r == "\x01\x00\x00"
|
||||
}
|
||||
|
||||
@@ -27,3 +27,10 @@ func (i *Info) discover() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsAppleSilicon returns true if the app is running on Apple Silicon
|
||||
// Credit: https://www.yellowduck.be/posts/detecting-apple-silicon-via-go/
|
||||
// NOTE: Not applicable to linux
|
||||
func IsAppleSilicon() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -43,3 +43,10 @@ func (i *Info) discover() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsAppleSilicon returns true if the app is running on Apple Silicon
|
||||
// Credit: https://www.yellowduck.be/posts/detecting-apple-silicon-via-go/
|
||||
// NOTE: Not applicable to windows
|
||||
func IsAppleSilicon() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user