namespace IOL.BookmarkThing.Server.Utilities;
public static class ConfigurationExtensions
{
///
/// Get the contents of AppData/version.txt.
///
///
///
public static string GetVersion(this IConfiguration configuration) {
var versionFilePath = Path.Combine(AppPaths.AppData.HostPath, "version.txt");
if (File.Exists(versionFilePath)) {
var versionText = File.ReadAllText(versionFilePath);
return versionText + "-" + configuration.GetValue("ASPNETCORE_ENVIRONMENT");
}
return "unknown-" + configuration.GetValue("ASPNETCORE_ENVIRONMENT");
}
}