Skip to content

Commit

Permalink
Cleanup cache appropriately
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/src/UnifyPatcher.cs
  • Loading branch information
HyperPolygon64 committed Feb 6, 2020
1 parent b10185e commit 279e3a9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,16 @@ public static string UnpackARC(string arc, string tempPath) {
/// Repacks an archive from a temporary location.
/// </summary>
public static void RepackARC(string arc, string output) {
string tempPath = Path.Combine(arc, Path.GetFileNameWithoutExtension(output));

ArcPacker repack = new ArcPacker();
repack.WriteArc(output, tempPath);
repack.WriteArc(output, Path.Combine(arc, Path.GetFileNameWithoutExtension(output)));

// Erases temporary repack data
try {
DirectoryInfo tempData = new DirectoryInfo(tempPath);
if (Directory.Exists(tempPath)) {
DirectoryInfo tempData = new DirectoryInfo(arc);
if (Directory.Exists(arc)) {
foreach (FileInfo file in tempData.GetFiles()) file.Delete();
foreach (DirectoryInfo directory in tempData.GetDirectories()) directory.Delete(true);
Directory.Delete(arc);
}
} catch { }
}
Expand Down

0 comments on commit 279e3a9

Please sign in to comment.