Skip to content

Commit

Permalink
[BUG] apax version comparision in results in exception when semver no…
Browse files Browse the repository at this point in the history
…n compliant version is used (#268)

* Create draft PR for #267

* fixes an issue when semever non compliant versions comparision produced exception.

---------

Co-authored-by: PTKu <PTKu@users.noreply.github.com>
Co-authored-by: Peter <61538034+PTKu@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 061e7aa commit d1f4013
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/AXSharp.compiler/src/AXSharp.Compiler/AxProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,15 @@ private static IEnumerable<string> SearchForApaxFiles(string directory, int curr

static bool AreVersionsCompatible(string v1, string v2)
{
var versionA = ParseVersion(v1);
var versionB = ParseVersion(v2);
bool v1SemverCompliant = Version.TryParse(v1, out Version? versionA);
bool v2SemverCompliant = Version.TryParse(v2, out Version? versionB);


if(!v1SemverCompliant || !v2SemverCompliant)
{
return v1?.Trim() == v2?.Trim();
}


if (v1.StartsWith("^") || v2.StartsWith("^"))
{
Expand Down

0 comments on commit d1f4013

Please sign in to comment.