Commit c8aafe4f authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

fixed duplicate detector

parent ae6e41e5
......@@ -6,6 +6,7 @@
"clean": "rimraf lib",
"build": "yarn run i18nGenerate && tsc",
"i18nGenerate": "gg-i18n --moduleName=client",
"i18nFindDuplicate": "gg-i18n-dd",
"test": "jest"
},
"dependencies": {
......
......@@ -5,6 +5,8 @@ const fileStream = require('fs');
const path = require('path');
const readlineSync = require('readline-sync');
const rootDirectory = process.cwd();
class II18n {
public filePath: string;
public key: string;
......@@ -27,7 +29,7 @@ const duplicates = new Map<string, II18n[]>();
async function main() {
console.log('Running...');
const dupes = fastGlob(['../../**/locales/en/common.json', '../../**/src/**/translations.json', '../../**/src/translations.json'])
const dupes = fastGlob([`${rootDirectory}/locales/en/common.json`, `${rootDirectory}/src/**/translations.json`, `${rootDirectory}/src/translations.json`])
.then((paths) => paths.filter((path) => !path.includes('node_modules')).map((path) => testFile(path)));
console.log('Awawiting results...', dupes);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment