prevents filename clashes

This commit is contained in:
benbierens 2024-07-31 14:49:42 +02:00
parent 017c71a6e8
commit 8e084d6ca0
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
1 changed files with 3 additions and 1 deletions

View File

@ -178,7 +178,9 @@ namespace CodexTests
{
var outputPath = Path.GetDirectoryName(lifecycle.Log.LogFile.FullFilename);
if (outputPath == null) throw new Exception("Logfile path is null");
var outputFile = Path.Combine(outputPath, attr.OutputFilename);
var filename = Path.GetFileNameWithoutExtension(lifecycle.Log.LogFile.FullFilename);
if (string.IsNullOrEmpty(filename)) throw new Exception("Logfile name is null or empty");
var outputFile = Path.Combine(outputPath, filename + "_" + attr.OutputFilename);
if (!outputFile.EndsWith(".owts")) outputFile += ".owts";
return outputFile;
}