From 32c7b8c436adf03199414ce90b8087b45c4580c6 Mon Sep 17 00:00:00 2001 From: icedream Date: Mon, 19 Jan 2015 09:31:57 +0100 Subject: [PATCH] Added --force option to enforce builds even for up-to-date servers. I am mostly using this for debugging reasons since I'm tired of manually deleting folders. --- src/updater/CommandLineOptions.cs | 3 +++ src/updater/Program.cs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) 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)