Make working directory name the same on all OS

This commit is contained in:
Tamas Vajk
2025-03-26 11:42:59 +01:00
parent f6968af3ae
commit 68f96d39d2

View File

@@ -37,7 +37,8 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
{
try
{
var relativePathToCsProj = Path.GetRelativePath(sourceDir, csprojFile);
var relativePathToCsProj = Path.GetRelativePath(sourceDir, csprojFile)
.Replace('\\', '/'); // Ensure we're generating the same hash regardless of the OS
var name = FileUtils.ComputeHash($"{relativePathToCsProj}\n{this.GetType().Name}");
using var tempDir = new TemporaryDirectory(Path.Join(FileUtils.GetTemporaryWorkingDirectory(out _), "source-generator"), "source generator temporary", logger);
var analyzerConfigPath = Path.Combine(tempDir.DirInfo.FullName, $"{name}.txt");