Added "-Job" argument

This commit is contained in:
Jaex 2022-11-05 23:54:09 +03:00
parent db9879ede3
commit 4772d8bb6c
2 changed files with 14 additions and 21 deletions

View file

@ -164,34 +164,27 @@ private static void CheckArgs(string[] args)
CLIManager cli = new CLIManager(args);
cli.ParseCommands();
CLICommand command = cli.GetCommand("AppVeyor");
AppVeyor = cli.IsCommandExist("AppVeyor");
if (AppVeyor)
{
Console.WriteLine("AppVeyor: " + AppVeyor);
}
CLICommand command = cli.GetCommand("Job");
if (command != null)
{
AppVeyor = true;
string parameter = command.Parameter;
string configuration = command.Parameter;
Console.WriteLine("AppVeyor: " + configuration);
if (configuration.Equals("Release", StringComparison.OrdinalIgnoreCase))
if (Enum.TryParse(parameter, out SetupJobs job))
{
Job = SetupJobs.Release;
}
else if (configuration.Equals("Debug", StringComparison.OrdinalIgnoreCase))
{
Job = SetupJobs.Debug;
}
else if (configuration.Equals("Steam", StringComparison.OrdinalIgnoreCase))
{
Job = SetupJobs.Steam;
}
else if (configuration.Equals("MicrosoftStore", StringComparison.OrdinalIgnoreCase))
{
Job = SetupJobs.MicrosoftStore;
Job = job;
}
else
{
Console.WriteLine("Invalid job: " + parameter);
Environment.Exit(0);
}
}

View file

@ -38,7 +38,7 @@ after_build:
- ps: |
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
{
& "ShareX.Setup\bin\$env:CONFIGURATION\ShareX.Setup.exe" -AppVeyor "$env:CONFIGURATION"
& "ShareX.Setup\bin\$env:CONFIGURATION\ShareX.Setup.exe" -AppVeyor -Job "$env:CONFIGURATION"
}
artifacts:
- path: ShareX-*-setup.exe