fix auto-updates

This commit is contained in:
zznty
2023-01-05 00:48:11 +07:00
parent ea08d60d58
commit b8be5b2dce

View File

@@ -100,8 +100,17 @@ namespace Torch.Managers
_log.Debug($"Unzipping {file.FullName}");
var targetFile = Path.Combine(extractPath, file.FullName);
_fsManager.SoftDelete(extractPath, file.FullName);
file.ExtractToFile(targetFile, true);
// if its a directory
if (Path.GetFileName(targetFile).Length == 0)
{
Directory.CreateDirectory(targetFile);
}
else
{
_fsManager.SoftDelete(extractPath, file.FullName);
file.ExtractToFile(targetFile, true);
}
}
//zip.ExtractToDirectory(extractPath); //throws exceptions sometimes?