feat: Add Zip Tool
This commit is contained in:
parent
0ae60e679d
commit
00a52543b8
3 changed files with 59 additions and 0 deletions
24
CreateZipFolder/Program.cs
Normal file
24
CreateZipFolder/Program.cs
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue