diff --git a/src/updater/CommandLineOptions.cs b/src/updater/CommandLineOptions.cs index 1e8f811..2980042 100644 --- a/src/updater/CommandLineOptions.cs +++ b/src/updater/CommandLineOptions.cs @@ -19,6 +19,9 @@ namespace CitizenMP.Server.Installer [Option("log", DefaultValue = true, HelpText = "Write a log file \"build.log\" to the output folder.")] public bool WriteLogFile { get; set; } + [Option("force", DefaultValue = false, HelpText = "Enforce rebuilding the server even if the server's version is up-to-date.")] + public bool ForceBuild { get; set; } + [ValueOption(0)] public string OutputPath { get; set; } diff --git a/src/updater/Program.cs b/src/updater/Program.cs index cd2548b..24b84db 100644 --- a/src/updater/Program.cs +++ b/src/updater/Program.cs @@ -6,6 +6,8 @@ using System.Linq; using System.Net; using System.Reflection; using System.Text.RegularExpressions; +using System.Xml.Linq; +using System.Xml.XPath; using CommandLine; using LibGit2Sharp; using Microsoft.Build.BuildEngine; @@ -149,7 +151,7 @@ namespace CitizenMP.Server.Installer // Check if we need to update by parsing AssemblyConfigurationAttribute in server assembly. // Should have a space-separated segment saying "CommitHash=". - if (binOutputDirectory.Exists) + if (!options.ForceBuild && binOutputDirectory.Exists) { var serverBins = binOutputDirectory .EnumerateFiles("*Server.exe", SearchOption.TopDirectoryOnly)