Implement --no-config-migrate option

This commit is contained in:
Archi
2021-05-20 22:42:30 +02:00
parent 039ea6038a
commit bdf541b058
3 changed files with 13 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ using SteamKit2;
namespace ArchiSteamFarm {
internal static class Program {
internal static bool ConfigMigrate { get; private set; } = true;
internal static bool ConfigWatch { get; private set; } = true;
internal static string? NetworkGroup { get; private set; }
internal static bool ProcessRequired { get; private set; }
@@ -502,6 +503,10 @@ namespace ArchiSteamFarm {
case "--network-group" when !cryptKeyNext && !networkGroupNext && !pathNext:
networkGroupNext = true;
break;
case "--no-config-migrate" when !cryptKeyNext && !networkGroupNext && !pathNext:
ConfigMigrate = false;
break;
case "--no-config-watch" when !cryptKeyNext && !networkGroupNext && !pathNext:
ConfigWatch = false;

View File

@@ -468,6 +468,10 @@ namespace ArchiSteamFarm.Steam.Storage {
return (null, null);
}
if (!Program.ConfigMigrate) {
return (botConfig, null);
}
botConfig.Saving = true;
string latestJson = JsonConvert.SerializeObject(botConfig, Formatting.Indented);
botConfig.Saving = false;

View File

@@ -378,6 +378,10 @@ namespace ArchiSteamFarm.Storage {
return (null, null);
}
if (!Program.ConfigMigrate) {
return (globalConfig, null);
}
globalConfig.Saving = true;
string latestJson = JsonConvert.SerializeObject(globalConfig, Formatting.Indented);
globalConfig.Saving = false;