diff --git a/assets/txt/txt_definition.txt b/assets/txt/txt_definition.txt new file mode 100644 index 00000000..c5f8086b --- /dev/null +++ b/assets/txt/txt_definition.txt @@ -0,0 +1,4 @@ +Text File + filter remove_matches .* + extension txt + 3rd_gen_scale 1.00 diff --git a/commands/util-public/cloc.js b/commands/util-public/cloc.js index 5df222ee..c4d70fc6 100644 --- a/commands/util-public/cloc.js +++ b/commands/util-public/cloc.js @@ -37,7 +37,12 @@ module.exports = class ClocCommand extends Command { if (this.cache) return this.cache; const { stdout, stderr } = await exec( path.join(__dirname, '..', '..', 'node_modules', '.bin', 'cloc'), - ['--json', '--exclude-dir=node_modules', path.join(__dirname, '..', '..')] + [ + '--json', + '--exclude-dir=node_modules', + `--read-lang-def=${path.join(__dirname, '..', '..', 'assets', 'txt', 'txt_definition.txt')}`, + path.join(__dirname, '..', '..') + ] ); if (stderr) throw new Error(stderr.trim()); this.cache = JSON.parse(stdout.trim());