Fix check order and improve verbosity

This commit is contained in:
Michiel Hazelhof 2025-09-14 09:56:00 +02:00
parent dca67ac781
commit 0e34e638b0
No known key found for this signature in database
GPG Key ID: EECB9B96355B5EBF

View File

@ -269,23 +269,30 @@ internal class Program
private static void Check() private static void Check()
{ {
if (!File.Exists(Cert.Value())) if (Cert == null || String.IsNullOrWhiteSpace(Cert.Value()))
{
App.Error.WriteLine("No certificate specified");
App.ShowHelp();
Environment.Exit(1);
}
else if (CoreDll == null || String.IsNullOrWhiteSpace(CoreDll.Value()))
{
App.Error.WriteLine("No core dll specified");
App.ShowHelp();
Environment.Exit(1);
}
else if (!File.Exists(Cert.Value()))
{ {
App.Error.WriteLine($"Can't find certificate at: {Cert.Value()}"); App.Error.WriteLine($"Can't find certificate at: {Cert.Value()}");
App.ShowHelp(); App.ShowHelp();
Environment.Exit(1); Environment.Exit(1);
} }
if (!File.Exists(CoreDll.Value())) else if (!File.Exists(CoreDll.Value()))
{ {
App.Error.WriteLine($"Can't find core dll at: {CoreDll.Value()}"); App.Error.WriteLine($"Can't find core dll at: {CoreDll.Value()}");
App.ShowHelp(); App.ShowHelp();
Environment.Exit(1); Environment.Exit(1);
} }
if (Cert == null || String.IsNullOrWhiteSpace(Cert.Value()) || CoreDll == null || String.IsNullOrWhiteSpace(CoreDll.Value()))
{
App.ShowHelp();
Environment.Exit(1);
}
} }
// checkUsername Checks that the username is a valid username // checkUsername Checks that the username is a valid username