Skip to content

Commit 6b7792e

Browse files
Try unlink
1 parent 21c902f commit 6b7792e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Source/HedgeModManager/LinuxCompatibility.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ await Task.Run(() =>
4343

4444
if (entry.FullName.EndsWith('/'))
4545
{
46-
// Untested, tests from HMM 7 to 8 is needed
47-
if (File.Exists(destinationPath))
46+
var fileinfo = new FileInfo(destinationPath);
47+
if (fileinfo.Exists)
4848
{
49-
var attributes = new FileInfo(destinationPath).Attributes;
50-
if (attributes.HasFlag(FileAttributes.ReparsePoint))
49+
if (fileinfo.Attributes.HasFlag(FileAttributes.ReparsePoint))
5150
{
5251
Logger.Debug($"Symlink detected, unlinking \"{destinationPath}\"");
53-
File.Delete(destinationPath);
52+
Directory.Delete(destinationPath);
5453
}
5554
else
5655
{

0 commit comments

Comments
 (0)