Add feature to pass appleId in CLI
MODIFY
WalletWasabi.Packager/ArgsProcessor.cs
WalletWasabi.Packager/ArgsProcessor.cs
+using System.Linq;
+
namespace WalletWasabi.Packager;
/// <summary>
@@ -33,4 +35,25 @@ public class ArgsProcessor
return false;
}
+
+ public (string AppleId, string Password) GetAppleIdAndPassword()
+ {
+ string appleId = "";
+ string password = "";
+
+ try
+ {
+ var appleidArg = Args.Where(a => a.Contains("appleid", StringComparison.InvariantCultureIgnoreCase)).First();
+ var parameters = appleidArg.Split("=")[1];
+ var idAndPassword = parameters.Split(":");
+ appleId = idAndPassword[0];
+ password = idAndPassword[1];
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+
+ return (appleId, password);
+ }
}

MODIFY
WalletWasabi.Packager/MacSignTools.cs
WalletWasabi.Packager/MacSignTools.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.Packager;
public static class MacSignTools
{
- public static void Sign()
+ public static void Sign(ArgsProcessor argsProcessor)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
@@ -53,21 +53,19 @@ public static class MacSignTools
Console.WriteLine("Phase: creating the working directory.");
- string? appleId = null;
- string? password = null;
- do
+ var (appleId, password) = argsProcessor.GetAppleIdAndPassword();
+
+ while (string.IsNullOrWhiteSpace(appleId))
{
Console.WriteLine("Enter appleId (email):");
appleId = Console.ReadLine();
}
- while (string.IsNullOrWhiteSpace(appleId));
- do
+ while (string.IsNullOrWhiteSpace(password))
{
Console.WriteLine("Enter password:");
password = Console.ReadLine();
}
- while (string.IsNullOrWhiteSpace(password));
if (Directory.Exists(workingDir))
{

MODIFY
WalletWasabi.Packager/Program.cs
WalletWasabi.Packager/Program.cs
@@ -62,7 +62,7 @@ public static class Program
// For now this is enough. If you run it on macOS you want to sign.
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
- MacSignTools.Sign();
+ MacSignTools.Sign(argsProcessor);
return;
}

Add feature to pass appleId in CLI