From d90160c926f7115da9a0df186db23e9a9b3bdad1 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 23 Apr 2021 21:25:26 -0400 Subject: [PATCH] Add txt file definiton --- assets/txt/txt_definition.txt | 4 ++++ commands/util-public/cloc.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 assets/txt/txt_definition.txt 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());