forked from rayschpp/soe-pack2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer.js
71 lines (69 loc) · 2.42 KB
/
packer.js
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
65
66
67
68
69
70
#!/usr/bin/env node
var path = require("path"),
packer = require("./soe-pack2.js"),
mode = process.argv[2],
excludeFiles = [];
switch (mode) {
case "manifest":
var inPath = process.argv[3],
outFile = process.argv[4];
fileListPath = process.argv[5];
if (!outFile) {
outFile = "manifest_" + Date.now() + ".txt";
}
packer.manifest(inPath, outFile, excludeFiles, fileListPath);
break;
case "filelist":
var inPath = process.argv[3],
outFile = process.argv[4];
fileListPath = process.argv[5];
if (!outFile) {
outFile = "filelist_" + Date.now() + ".txt";
}
packer.genFileList(inPath, outFile, excludeFiles, fileListPath);
break;
case "diff":
var oldManifest = process.argv[3],
newManifest = process.argv[4],
outFile = process.argv[5];
if (!outFile) {
outFile = "diff_" + Date.now() + ".json";
}
packer.diff(oldManifest, newManifest, outFile);
break;
case "extractall":
var inPath = process.argv[3],
outPath = process.argv[4];
fileListPath = process.argv[5];
packer.extractAll(inPath, outPath, excludeFiles, fileListPath);
break;
case "extractpack":
var inPath = process.argv[3],
outPath = process.argv[4];
fileListPath = process.argv[5];
packer.extractPack(inPath, outPath, excludeFiles, fileListPath);
break;
case "extractdiff":
var diffPath = process.argv[3],
packPath = process.argv[4],
outPath = process.argv[5];
fileListPath = process.argv[6];
packer.extractDiff(diffPath, packPath, outPath, excludeFiles, fileListPath);
break;
case "extract":
var inPath = process.argv[3],
file = process.argv[4],
outPath = process.argv[5];
fileListPath = process.argv[6];
packer.extractFile(inPath, file, outPath, excludeFiles, fileListPath);
break;
case "extractregexp":
var inPath = process.argv[3],
file = process.argv[4],
outPath = process.argv[5];
fileListPath = process.argv[6];
packer.extractFile(inPath, file, outPath, excludeFiles, fileListPath, true);
break;
default:
console.log("Usage: node packer.js <mode> ...");
}