-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
64 lines (53 loc) · 2.49 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using K4os.Compression.LZ4;
using Newtonsoft.Json;
namespace JamPacker
{
class Program
{
static int Main(string[] args)
{
Console.WriteLine("Starting JamPacker...");
if (args.Length == 0)
{
Console.Write("Invalid parameters! Please specify either the 'Enumerate' flag before building your project to create enumerations and a manifest for all available");
Console.WriteLine("assets, or the 'Pack' flag after building your project to pack enumerated assets into archives.");
Console.WriteLine("Example: JamPacker Enumerate [AssetDirectory] [OutputDirectory]");
Console.WriteLine("Example: JamPacker Pack [AssetDirectory] [OutputDirectory]");
return -1;
}
if (args[0].ToLower() == "enumerate")
{
if (args.Length < 3)
{
Console.WriteLine("Invalid parameters! Please specify an asset directory path and an output directory path when using the 'Enumerate' flag.");
Console.WriteLine("Example: JamPacker Enumerate [AssetDirectory] [OutputDirectory]");
return -1;
}
return AssetEnumerator.EnumerateAssets(args) ? 0 : -1;
}
else if (args[0].ToLower() == "pack")
{
if (args.Length < 3)
{
Console.WriteLine("Invalid parameters! Please specify an asset directory path and an output directory path when using the 'Pack' flag.");
Console.WriteLine("Example: JamPacker Pack [AssetDirectory] [OutputDirectory]");
return -1;
}
return AssetPacker.PackAssets(args) ? 0 : -1;
}
else
{
Console.Write("Invalid parameters! Please specify either the 'Enumerate' flag before building your project to create enumerations and a manifest for all available");
Console.WriteLine("assets, or the 'Pack' flag after building your project to pack enumerated assets into archives.");
Console.WriteLine("Example: JamPacker Enumerate [AssetDirectory] [OutputDirectory]");
Console.WriteLine("Example: JamPacker Pack [AssetDirectory] [OutputDirectory]");
return -1;
}
}
}
}