fixed bug with incorrect file.Remove()

This commit is contained in:
2024-01-06 01:07:28 +06:00
parent f30b7e1e4d
commit 4f7017e486
3 changed files with 25 additions and 20 deletions

View File

@@ -24,12 +24,12 @@ public static class Manifests
var manifestPath = Path.Concat(dir, "manifest.dtsod");
if (Directory.GetFiles(dir).Contains(manifestPath))
File.Delete(manifestPath);
foreach (var _file in Directory.GetAllFiles(dir))
foreach (var fileInDir in Directory.GetAllFiles(dir))
{
var file = _file.Remove(0, dir.Length);
manifestBuilder.Append(file);
var fileRelative = fileInDir.RemoveBase(dir);
manifestBuilder.Append(fileRelative);
manifestBuilder.Append(": \"");
byte[] hash = hasher.HashFile(Path.Concat(dir, file));
byte[] hash = hasher.HashFile(Path.Concat(fileInDir));
manifestBuilder.Append(hash.HashToString());
manifestBuilder.Append("\";\n");
}