Skip to content

Commit

Permalink
Fix Irony not being able to recognize new json format properly to aut…
Browse files Browse the repository at this point in the history
…o determine game paths
  • Loading branch information
bcssov committed Jul 5, 2024
1 parent f69af05 commit f77e055
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/IronyModManager.IO.Common/PathOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
// Created : 09-12-2021
//
// Last Modified By : Mario
// Last Modified On : 09-12-2021
// Last Modified On : 07-05-2024
// ***********************************************************************
// <copyright file="PathOperations.cs" company="Mario">
// Mario
// </copyright>
// <summary></summary>
// ***********************************************************************

using System;
using System.Collections.Generic;
using System.IO;
Expand All @@ -35,11 +36,12 @@ public static class PathOperations
public static string ResolveRelativePath(string basePath, string path)
{
var result = ResolveRelativePath(basePath, path, false);
if ((!File.Exists(result) || !Directory.Exists(result)) && PathContainsRelativeSegments(path))
if (!File.Exists(result) && !Directory.Exists(result) && PathContainsRelativeSegments(path))
{
// Fallback
result = ResolveRelativePath(basePath, path, true);
}

return result;
}

Expand Down Expand Up @@ -69,15 +71,17 @@ private static string ResolveRelativePath(string basePath, string path, bool che
{
basePath = Path.Combine(basePath, "dummy");
}

string result;
if (string.IsNullOrWhiteSpace(basePath) || !Path.IsPathFullyQualified(basePath))
{
result = Path.Combine(basePath, path);
result = Path.Combine(basePath!, path);
}
else
{
result = Path.GetFullPath(path, basePath);
}

return result;
}

Expand Down

0 comments on commit f77e055

Please sign in to comment.