Add dirty commit warning

This commit is contained in:
jvyden 2021-11-19 00:22:14 -05:00
commit 76aeb54da0
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -17,11 +17,27 @@ namespace LBPUnion.ProjectLighthouse.Helpers
}
catch
{
Logger.Log("Project Lighthouse was built incorrectly. Please make sure git is available when building.", LoggerLevelStartup.Instance);
Logger.Log
(
"Project Lighthouse was built incorrectly. Please make sure git is available when building. " +
"Because of this, you will not be notified of updates.",
LoggerLevelStartup.Instance
);
CommitHash = "invalid";
Branch = "invalid";
CanCheckForUpdates = false;
}
if (IsDirty)
{
Logger.Log
(
"This is a modified version of Project Lighthouse. " +
"Please make sure you are properly disclosing the source code to any users who may be using this instance.",
LoggerLevelStartup.Instance
);
CanCheckForUpdates = false;
}
}
private static string readManifestFile(string fileName)
@ -34,6 +50,7 @@ namespace LBPUnion.ProjectLighthouse.Helpers
public static string CommitHash { get; set; }
public static string Branch { get; set; }
public static bool IsDirty => CommitHash.EndsWith("-dirty");
public static bool CanCheckForUpdates { get; set; }
}
}