-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from BUTR/dev
Release
- Loading branch information
Showing
16 changed files
with
398 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -351,3 +351,4 @@ MigrationBackup/ | |
|
||
# Ionide (cross platform F# VS Code tools) working folder | ||
.ionide/ | ||
/src/.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#r "nuget: Newtonsoft.Json, 13.0.3" | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
|
||
using System.Threading.Tasks; | ||
|
||
using Newtonsoft.Json; | ||
|
||
public class NuGetVersions | ||
{ | ||
public required List<string> Versions { get; init; } | ||
} | ||
|
||
public class NexusModsLatestVersion | ||
{ | ||
public required string Message { get; init; } | ||
} | ||
|
||
private static readonly string NuGet = "https://api.nuget.org/v3-flatcontainer/lib.harmony/index.json"; | ||
private static readonly string RunKit = "https://nexusmods-version-pzk4e0ejol6j.runkit.sh/?gameId=mountandblade2bannerlord&modId=2006"; | ||
|
||
Version nuGetVersion; | ||
Version nexusModsLatestVersion; | ||
|
||
try | ||
{ | ||
var client = new HttpClient(); | ||
nuGetVersion = JsonConvert.DeserializeObject<NuGetVersions>(await client.GetStringAsync(NuGet)).Versions.Select(Version.Parse).MaxBy(x => x); | ||
nexusModsLatestVersion = Version.Parse(JsonConvert.DeserializeObject<NexusModsLatestVersion>(await client.GetStringAsync(RunKit)).Message); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine(1); | ||
//Console.WriteLine(e); | ||
return; | ||
} | ||
|
||
if (nexusModsLatestVersion == nuGetVersion) | ||
Console.WriteLine(2); | ||
|
||
if (nexusModsLatestVersion > nuGetVersion) | ||
Console.WriteLine(3); | ||
|
||
if (nexusModsLatestVersion < nuGetVersion) | ||
Console.WriteLine(0); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.