Skip to content

Commit

Permalink
fixes an issue when semever non compliant versions comparision produc…
Browse files Browse the repository at this point in the history
…ed exception.
  • Loading branch information
PTKu committed Nov 28, 2023
1 parent 3741267 commit eee6b6b
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 eee6b6b

Please sign in to comment.