scancscode 1.0.3 → 1.0.5
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.
package/dist/LiteralCollector.js
CHANGED
|
@@ -46,8 +46,8 @@ class LiteralCollector {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
let files = glob_1.glob.sync("**/*.cs", { cwd: folder });
|
|
49
|
-
let testFullPath = "@";
|
|
50
|
-
|
|
49
|
+
// let testFullPath = "@";
|
|
50
|
+
let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/Shop/SuperGiftsDialog.cs";
|
|
51
51
|
for (const filePath of files) {
|
|
52
52
|
let fullPath = folder + filePath;
|
|
53
53
|
if (testFullPath != "@") {
|
|
@@ -102,7 +102,9 @@ class LiteralCollector {
|
|
|
102
102
|
this.scanTablesInFolder(gameConfigFolder, literals, verbose);
|
|
103
103
|
}
|
|
104
104
|
this.filterLiterals(literals);
|
|
105
|
-
|
|
105
|
+
if (verbose) {
|
|
106
|
+
console.log("扫描合并结果:", literals);
|
|
107
|
+
}
|
|
106
108
|
await CSVUtils_1.CSVUtils.updateToFile(outCsvFile, literals, langs);
|
|
107
109
|
for (const unexpect of unexpects) {
|
|
108
110
|
console.error(unexpect);
|
package/package.json
CHANGED
package/src/CSCodeScanner.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class CSCodeScanner {
|
|
|
11
11
|
// 正则表达式匹配 匹配每个字符串
|
|
12
12
|
private static readonly stringPattern = /\$?"([^"]*)"/mg;
|
|
13
13
|
// 正则表达式匹配插值表达式 {...}
|
|
14
|
-
private static readonly interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#]+)?\}/mg;
|
|
14
|
+
private static readonly interpolationPattern = /\{([^}]+?)(\:[a-zA-Z\d-\.\#(?:\\\\:)]+)?\}/mg;
|
|
15
15
|
|
|
16
16
|
private static readonly stringFormatPattern = /(?<![a-zA-Z_])([sS]tring\.Format)(?=\(.*?\))/mg;
|
|
17
17
|
|
package/src/CmdExecutor.ts
CHANGED
|
@@ -8,7 +8,7 @@ function isNullOrEmpty<T>(arr: T[]): boolean {
|
|
|
8
8
|
|
|
9
9
|
export class CmdExecutor {
|
|
10
10
|
static testConvert() {
|
|
11
|
-
let cwd = "
|
|
11
|
+
let cwd = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/"
|
|
12
12
|
let cscodeFolders = [cwd + "Assets/Bundles/FGUI/"]
|
|
13
13
|
let gameConfigFolders = [cwd + "Assets/Bundles/GameConfigs/"]
|
|
14
14
|
let outCsvFile = "E:/DATA/Projects/e-gbl-client/client/Assets/Bundles/GameConfigs/Translation/hello.csv"
|
package/src/LiteralCollector.ts
CHANGED
|
@@ -14,8 +14,8 @@ export class LiteralCollector {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
let files = glob.sync("**/*.cs", { cwd: folder });
|
|
17
|
-
let testFullPath = "@";
|
|
18
|
-
|
|
17
|
+
// let testFullPath = "@";
|
|
18
|
+
let testFullPath = "E:/DATA/Projects/ZhiYou/ProjectFClient/GameClient/Assets/Bundles/FGUI/Shop/SuperGiftsDialog.cs";
|
|
19
19
|
for (const filePath of files) {
|
|
20
20
|
let fullPath = folder + filePath;
|
|
21
21
|
if (testFullPath != "@") {
|
|
@@ -79,7 +79,9 @@ export class LiteralCollector {
|
|
|
79
79
|
}
|
|
80
80
|
this.filterLiterals(literals);
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
if (verbose) {
|
|
83
|
+
console.log("扫描合并结果:", literals);
|
|
84
|
+
}
|
|
83
85
|
await CSVUtils.updateToFile(outCsvFile, literals, langs);
|
|
84
86
|
for (const unexpect of unexpects) {
|
|
85
87
|
console.error(unexpect);
|