mirror of https://github.com/ppy/osu
Add non-interactive deploy mode
This commit is contained in:
parent
dd7020d5a4
commit
278a878b09
|
@ -57,8 +57,12 @@ internal static class Program
|
|||
|
||||
private static string codeSigningPassword;
|
||||
|
||||
private static bool interactive;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
interactive = args.Length == 0;
|
||||
|
||||
displayHeader();
|
||||
|
||||
findSolutionPath();
|
||||
|
@ -82,15 +86,15 @@ public static void Main(string[] args)
|
|||
string version = $"{verBase}{increment}";
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Write($"Ready to deploy {version}: ");
|
||||
Console.ReadLine();
|
||||
Console.Write($"Ready to deploy {version}!");
|
||||
pauseIfInteractive();
|
||||
|
||||
sw.Start();
|
||||
|
||||
if (!string.IsNullOrEmpty(CodeSigningCertificate))
|
||||
{
|
||||
Console.Write("Enter code signing password: ");
|
||||
codeSigningPassword = readLineMasked();
|
||||
codeSigningPassword = args.Length > 0 ? args[0] : readLineMasked();
|
||||
}
|
||||
|
||||
write("Updating AssemblyInfo...");
|
||||
|
@ -124,7 +128,7 @@ public static void Main(string[] args)
|
|||
updateCsprojVersion("0.0.0");
|
||||
|
||||
write("Done!", ConsoleColor.White);
|
||||
Console.ReadLine();
|
||||
pauseIfInteractive();
|
||||
}
|
||||
|
||||
private static void displayHeader()
|
||||
|
@ -388,10 +392,18 @@ private static void error(string message)
|
|||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"FATAL ERROR: {message}");
|
||||
|
||||
Console.ReadLine();
|
||||
pauseIfInteractive();
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
|
||||
private static void pauseIfInteractive()
|
||||
{
|
||||
if (interactive)
|
||||
Console.ReadLine();
|
||||
else
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
private static void write(string message, ConsoleColor col = ConsoleColor.Gray)
|
||||
{
|
||||
if (sw.ElapsedMilliseconds > 0)
|
||||
|
|
Loading…
Reference in New Issue