Skip to content

Commit 7d29486

Browse files
authored
Merge pull request #3 from miifanboy/master
Added a function to return the latest version as a string
2 parents 96369c1 + 8edfce9 commit 7d29486

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

GithubUpdateCheck/GithubUpdateCheck.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,16 @@ private string NormalizeVersionString(string version)
289289
return NormalizeVersionStringBoolean(version);
290290
}
291291
}
292-
293-
292+
/// <summary>
293+
/// Returns the latest version on github
294+
/// </summary>
295+
/// <returns>normalized string</returns>
296+
public string Version()
297+
{
298+
string resolved = GetResponseUrl(githubUrl + Username + "/" + Repository + latestVersionString);
299+
string version = NormalizeVersionString(resolved);
300+
return version;
301+
}
294302
/// <summary>
295303
/// Removes leading v. and v from the string
296304
/// </summary>
@@ -544,4 +552,4 @@ private static async Task<string> GetResponseUrlAsync(string request)
544552

545553
}
546554
#pragma warning restore CA1724 // Do not warn about namespace/classname conflict
547-
}
555+
}

0 commit comments

Comments
 (0)