feat: Add Zip Tool

This commit is contained in:
Mira 2024-02-17 15:40:47 +01:00
parent 0ae60e679d
commit 00a52543b8
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36
3 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,24 @@
using System.IO.Compression;
var env = Environment.GetCommandLineArgs();
if (env.Length < 3)
{
Console.WriteLine("Arguments required: [Directory] [OutputFile]");
return 1;
}
if (!new DirectoryInfo(env[1]).Exists)
{
Console.WriteLine($"'{env[1]}' does not exist.");
return 1;
}
if (new FileInfo(env[2]).Exists)
{
Console.WriteLine($"'{env[2]}' already exists.");
return 1;
}
ZipFile.CreateFromDirectory(env[1], env[2]);
return 0;