Skip to content

Commit 795a5cb

Browse files
committed
Add a method that checks if a SerializableInstallOptions differs or not from the default values
1 parent d1393d0 commit 795a5cb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/UniGetUI.PackageEngine.Serializable/SerializableInstallationOptions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ public override void LoadFromJson(JsonNode data)
5151
this.SkipMinorUpdates = data[nameof(SkipMinorUpdates)]?.GetVal<bool>() ?? false;
5252
}
5353

54+
public bool DiffersFromDefault()
55+
{
56+
return SkipHashCheck is not false ||
57+
InteractiveInstallation is not false ||
58+
RunAsAdministrator is not false ||
59+
PreRelease is not false ||
60+
SkipMinorUpdates is not false ||
61+
Architecture.Any() ||
62+
InstallationScope.Any() ||
63+
CustomParameters.Where(x => x != "").Any() ||
64+
CustomInstallLocation.Any() ||
65+
Version.Any();
66+
}
67+
5468
public SerializableInstallationOptions() : base()
5569
{
5670
}

0 commit comments

Comments
 (0)