Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 7562f7d

Browse files
Fixing it up a bit
1 parent dd6bc56 commit 7562f7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/GitHub.Api/Installer/CopyHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ public static void Copy(NPath fromPath, NPath toPath)
3131
throw;
3232
}
3333
}
34+
finally
35+
{
36+
fromPath.DeleteIfExists();
37+
}
3438
}
3539
public static void CopyFolder(NPath fromPath, NPath toPath)
3640
{
3741
Logger.Trace("CopyFolder fromPath: {0} toPath:{1}", fromPath.ToString(), toPath.ToString());
3842

3943
toPath.EnsureParentDirectoryExists();
4044
fromPath.Move(toPath);
41-
fromPath.Delete();
4245
}
4346

4447
public static void CopyFolderContents(NPath fromPath, NPath toPath)
@@ -47,7 +50,6 @@ public static void CopyFolderContents(NPath fromPath, NPath toPath)
4750

4851
toPath.DeleteContents();
4952
fromPath.MoveFiles(toPath, true);
50-
fromPath.Delete();
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)