load modpack info before modpack installer
This commit is contained in:
@@ -73,8 +73,9 @@ public static class Program
|
||||
|
||||
private static void InstallWithoutGui(UpdateCheckOptionsAdv updateOptions, bool silent)
|
||||
{
|
||||
var config = ModpackConfig.LoadFromUrl(updateOptions.ModpackConfig);
|
||||
var installer = new ModpackInstaller(config, updateOptions.ProfileFolder);
|
||||
var info = ModpackInfo.TryLoad(updateOptions.ProfileFolder);
|
||||
var config = ModpackConfig.LoadFromUrl(CheckModpackConfigUrl(updateOptions.ModpackConfig, info));
|
||||
var installer = new ModpackInstaller(config, info);
|
||||
var result = installer.Check(updateOptions).Result;
|
||||
|
||||
if (!silent && !updateOptions.NoUpdate && new AppUpdater().Check().Result)
|
||||
@@ -89,4 +90,11 @@ public static class Program
|
||||
else if (!silent)
|
||||
Console.WriteLine("No updates available");
|
||||
}
|
||||
|
||||
private static string CheckModpackConfigUrl(string configUrl, ModpackInfo info)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(configUrl) && !string.IsNullOrWhiteSpace(info.ConfigUrl))
|
||||
return info.ConfigUrl;
|
||||
return configUrl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user