From 5dbe62bcba7f2cb979f413209dc4e97a5069d738 Mon Sep 17 00:00:00 2001 From: Brendan McShane Date: Sat, 20 Nov 2021 17:59:53 -0500 Subject: [PATCH] Add osx-arm64 support to electronize command Updates the GetTargetPlatformInformationResult() function to add 'osx-arm64' target. Updates the 'default' case to automatically detect M1 mac. --- .../Actions/GetTargetPlatformInformation.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs b/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs index a12d427..159a44d 100644 --- a/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs +++ b/ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs @@ -27,6 +27,10 @@ namespace ElectronNET.CLI.Commands.Actions netCorePublishRid = "osx-x64"; electronPackerPlatform = "mac"; break; + case "osx-arm64": + netCorePublishRid = "osx-arm64"; + electronPackerPlatform = "darwin-arm64"; + break; case "linux": netCorePublishRid = "linux-x64"; electronPackerPlatform = "linux"; @@ -48,8 +52,17 @@ namespace ElectronNET.CLI.Commands.Actions } if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - netCorePublishRid = "osx-x64"; - electronPackerPlatform = "mac"; + if (RuntimeInformation.OSArchitecture.Equals(Architecture.Arm64)) + { + //Apple Silicon Mac: + netCorePublishRid = "osx-arm64"; + electronPackerPlatform = "darwin-arm64"; + } + else{ + //Intel Mac: + netCorePublishRid = "osx-x64"; + electronPackerPlatform = "mac"; + } } if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {