Skip to content

Commit

Permalink
Fix path format.
Browse files Browse the repository at this point in the history
  • Loading branch information
inversionhourglass committed Oct 15, 2024
1 parent f66301e commit 21df4b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Cli4Fody/Arguments/TargetPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private TargetPath(string value)
{
if (!Path.IsPathRooted(value))
{
value = Path.Combine(System.IO.Directory.GetCurrentDirectory(), value);
value = Path.Combine(System.IO.Directory.GetCurrentDirectory(), NativePath(value));
}
Value = value;
Directory = Path.GetDirectoryName(value)!;
Expand Down Expand Up @@ -43,7 +43,7 @@ public string[] GetProjectPaths()
var solutionContent = File.ReadAllText(Value);
var matches = ProjectMatcher().Matches(solutionContent);

_projectPaths = matches.Select(x => Path.Combine(Directory, x.Groups[1].Value)).ToArray();
_projectPaths = matches.Select(x => Path.Combine(Directory, NativePath(x.Groups[1].Value))).ToArray();
}
}

Expand All @@ -57,6 +57,8 @@ public static TargetPath Parse(string targetPath)
return new(targetPath);
}

private static string NativePath(string path) => path.Replace('\\', Path.DirectorySeparatorChar);

[GeneratedRegex(@"Project\("".*""\) = "".*"", ""([^""]+\.csproj)""")]
private static partial Regex ProjectMatcher();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cli4Fody/Cli4Fody.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<Authors>ihourglass</Authors>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit 21df4b0

Please sign in to comment.