From fab5f2c8164671aaaee37524acbb22e1a8b1a52a Mon Sep 17 00:00:00 2001 From: That_One_Nerd Date: Fri, 17 Mar 2023 10:13:56 -0400 Subject: [PATCH] Crap. I forgot to test :( --- SrcMod/Shell/Modules/CompressionModule.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SrcMod/Shell/Modules/CompressionModule.cs b/SrcMod/Shell/Modules/CompressionModule.cs index ee03f0b..35742a9 100644 --- a/SrcMod/Shell/Modules/CompressionModule.cs +++ b/SrcMod/Shell/Modules/CompressionModule.cs @@ -3,6 +3,7 @@ [Module("compress")] public static class CompressionModule { + [Command("zip")] public static void CompressZip(string source, string? destination = null, CompressionLevel level = CompressionLevel.Optimal) { @@ -75,19 +76,19 @@ public static class CompressionModule { action = delegate { - if (!File.Exists(absDest)) + if (!File.Exists(destination)) { Write("Looks like the job is already completed Boss.", ConsoleColor.DarkYellow); return; } - FileInfo info = new(absDest); + FileInfo info = new(destination); if ((info.LastWriteTime - stamp).TotalMilliseconds >= 10) throw new("The archive has been modified and probably shouldn't be undone."); - File.Delete(absDest); + File.Delete(destination); }, - name = $"Compressed a file or folder into a {type} archive located at \"{destination}\"" + name = $"Compressed a file or folder into a zip archive located at \"{destination}\"" }); } }