scancscode 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ class CmdExecutor {
21
21
  literalCollector.convert(cscodeFolders, gameConfigFolders, outCsvFile, langs);
22
22
  // node . --cscodedir ../../../GameClient/Assets/Bundles/FGUI/ --configdir ../../../GameClient/Assets/Bundles/GameConfigs/ --outcsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello.csv --langs zh_cn
23
23
  }
24
- static runConvertWithCmdOptions() {
24
+ static async runConvertWithCmdOptions() {
25
25
  const optionDefinitions = [
26
26
  { name: 'cscodedir', type: String, multiple: true },
27
27
  { name: 'configdir', type: String, multiple: true },
@@ -56,7 +56,7 @@ class CmdExecutor {
56
56
  }
57
57
  console.log(`convert cmd options: `, cscodedir, configdir, outcsv, langs, verbose);
58
58
  let literalCollector = new LiteralCollector_1.LiteralCollector();
59
- literalCollector.convert(cscodedir, configdir, outcsv, langs, verbose);
59
+ await literalCollector.convert(cscodedir, configdir, outcsv, langs, verbose);
60
60
  console.log("convert done.");
61
61
  }
62
62
  static testSlimCsv() {
@@ -66,7 +66,7 @@ class CmdExecutor {
66
66
  CSVUtils_1.CSVUtils.slimCsvWithLangs(inCsvFile, outCsvFile, langs);
67
67
  // node bin/slimlangs.js --incsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello.csv --outcsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello-out.csv --langs zh_cn
68
68
  }
69
- static runSlimCsvWithLangs() {
69
+ static async runSlimCsvWithLangs() {
70
70
  const optionDefinitions = [
71
71
  { name: 'incsv', type: String, multiple: true },
72
72
  { name: 'outcsv', type: String },
@@ -90,7 +90,7 @@ class CmdExecutor {
90
90
  console.error(`langs missing:`, argv);
91
91
  return;
92
92
  }
93
- CSVUtils_1.CSVUtils.slimCsvWithLangs(incsv, outcsv, langs);
93
+ await CSVUtils_1.CSVUtils.slimCsvWithLangs(incsv, outcsv, langs);
94
94
  console.log("slim csv with langs done.");
95
95
  }
96
96
  }
@@ -92,7 +92,7 @@ class LiteralCollector {
92
92
  literals.length = 0;
93
93
  literals.push(...literalsSet);
94
94
  }
95
- convert(cscodeFolders, gameConfigFolders, outCsvFile, langs, verbose = false) {
95
+ async convert(cscodeFolders, gameConfigFolders, outCsvFile, langs, verbose = false) {
96
96
  let literals = [];
97
97
  let unexpects = [];
98
98
  for (const cscodeFolder of cscodeFolders) {
@@ -106,7 +106,7 @@ class LiteralCollector {
106
106
  console.error(unexpect);
107
107
  }
108
108
  console.log(literals);
109
- CSVUtils_1.CSVUtils.updateToFile(outCsvFile, literals, langs);
109
+ await CSVUtils_1.CSVUtils.updateToFile(outCsvFile, literals, langs);
110
110
  }
111
111
  }
112
112
  exports.LiteralCollector = LiteralCollector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scancscode",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -17,7 +17,7 @@ export class CmdExecutor {
17
17
  literalCollector.convert(cscodeFolders, gameConfigFolders, outCsvFile, langs)
18
18
  // node . --cscodedir ../../../GameClient/Assets/Bundles/FGUI/ --configdir ../../../GameClient/Assets/Bundles/GameConfigs/ --outcsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello.csv --langs zh_cn
19
19
  }
20
- static runConvertWithCmdOptions() {
20
+ static async runConvertWithCmdOptions() {
21
21
  const optionDefinitions = [
22
22
  { name: 'cscodedir', type: String, multiple: true },
23
23
  { name: 'configdir', type: String, multiple: true },
@@ -53,7 +53,7 @@ export class CmdExecutor {
53
53
  }
54
54
  console.log(`convert cmd options: `, cscodedir, configdir, outcsv, langs, verbose)
55
55
  let literalCollector = new LiteralCollector();
56
- literalCollector.convert(cscodedir, configdir, outcsv, langs, verbose)
56
+ await literalCollector.convert(cscodedir, configdir, outcsv, langs, verbose)
57
57
  console.log("convert done.")
58
58
  }
59
59
  static testSlimCsv() {
@@ -63,7 +63,7 @@ export class CmdExecutor {
63
63
  CSVUtils.slimCsvWithLangs(inCsvFile, outCsvFile, langs);
64
64
  // node bin/slimlangs.js --incsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello.csv --outcsv E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello-out.csv --langs zh_cn
65
65
  }
66
- static runSlimCsvWithLangs() {
66
+ static async runSlimCsvWithLangs() {
67
67
  const optionDefinitions = [
68
68
  { name: 'incsv', type: String, multiple: true },
69
69
  { name: 'outcsv', type: String },
@@ -88,7 +88,7 @@ export class CmdExecutor {
88
88
  console.error(`langs missing:`, argv);
89
89
  return;
90
90
  }
91
- CSVUtils.slimCsvWithLangs(incsv, outcsv, langs);
91
+ await CSVUtils.slimCsvWithLangs(incsv, outcsv, langs);
92
92
  console.log("slim csv with langs done.");
93
93
  }
94
94
  }
@@ -67,7 +67,7 @@ export class LiteralCollector {
67
67
  literals.push(...literalsSet);
68
68
  }
69
69
 
70
- convert(cscodeFolders: string[], gameConfigFolders: string[], outCsvFile: string, langs: string[], verbose: boolean = false) {
70
+ async convert(cscodeFolders: string[], gameConfigFolders: string[], outCsvFile: string, langs: string[], verbose: boolean = false) {
71
71
 
72
72
  let literals: string[] = [];
73
73
  let unexpects: string[] = [];
@@ -79,10 +79,10 @@ export class LiteralCollector {
79
79
  }
80
80
  this.filterLiterals(literals);
81
81
 
82
+ console.log(literals);
83
+ await CSVUtils.updateToFile(outCsvFile, literals, langs);
82
84
  for (const unexpect of unexpects) {
83
85
  console.error(unexpect);
84
86
  }
85
- console.log(literals);
86
- CSVUtils.updateToFile(outCsvFile, literals, langs);
87
87
  }
88
88
  }