Skip to content

Commit

Permalink
Merge pull request #58 from ItsShamed/fix/duplicate-path-separator
Browse files Browse the repository at this point in the history
fix: remove duplicate path separator
  • Loading branch information
smoogipoo authored Jul 6, 2023
2 parents 67ca447 + b2c3a5d commit c424c56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion LocalisationAnalyser.Tools/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ private static async Task projectToResX(FileInfo projectFile, DirectoryInfo? out
localisationFile = await LocalisationFile.ReadAsync(stream);

string targetDirectory = output != null ? output.FullName : Path.GetDirectoryName(file.FilePath)!;

if (file.Folders.Count > 1)
targetDirectory += Path.DirectorySeparatorChar + string.Join(Path.DirectorySeparatorChar, file.Folders.Skip(1));
{
string subNamespaceDirectory = Path.Join(file.Folders.Skip(1).ToArray());
targetDirectory = Path.Join(targetDirectory, subNamespaceDirectory);
}

string targetFileName = localisationFile.Prefix[(localisationFile.Prefix.LastIndexOf('.') + 1)..];
string resxFile = Path.Combine(targetDirectory, $"{targetFileName}.resx");
Expand Down

0 comments on commit c424c56

Please sign in to comment.