diff --git a/v2/internal/system/system.go b/v2/internal/system/system.go index 8b70b102..b7061ea6 100644 --- a/v2/internal/system/system.go +++ b/v2/internal/system/system.go @@ -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" -} diff --git a/v2/internal/system/system_darwin.go b/v2/internal/system/system_darwin.go index a6fff0cd..f476e496 100644 --- a/v2/internal/system/system_darwin.go +++ b/v2/internal/system/system_darwin.go @@ -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" +} diff --git a/v2/internal/system/system_linux.go b/v2/internal/system/system_linux.go index 4cb1d959..de62b472 100644 --- a/v2/internal/system/system_linux.go +++ b/v2/internal/system/system_linux.go @@ -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 +} diff --git a/v2/internal/system/system_windows.go b/v2/internal/system/system_windows.go index 8cebe41c..6ef67c35 100644 --- a/v2/internal/system/system_windows.go +++ b/v2/internal/system/system_windows.go @@ -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 +}