Auto remove deleted files from summary
This commit is contained in:
parent
a5ef1ce363
commit
c7893f9958
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import "dotenv/config";
|
import "dotenv/config";
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { readFileSync, writeFileSync } from "fs";
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||||
|
|
||||||
const files = execSync('fd --type f -g "*.json"')
|
const files = execSync('fd --type f -g "*.json"')
|
||||||
.toString()
|
.toString()
|
||||||
@ -31,6 +31,12 @@ async function main() {
|
|||||||
writeFileSync("summary.json", JSON.stringify(out, null, 2));
|
writeFileSync("summary.json", JSON.stringify(out, null, 2));
|
||||||
await new Promise((r) => setTimeout(r, 500));
|
await new Promise((r) => setTimeout(r, 500));
|
||||||
}
|
}
|
||||||
|
for (let k of Object.keys(out)){
|
||||||
|
if (!existsSync(k)){
|
||||||
|
delete out[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writeFileSync("summary.json", JSON.stringify(out, null, 2));
|
||||||
const BLACKLIST = ['ane rank 16', 'Blank.', 'conversation between a user and a helpful assistant']
|
const BLACKLIST = ['ane rank 16', 'Blank.', 'conversation between a user and a helpful assistant']
|
||||||
const ENTRIES = Object.entries(out).filter(
|
const ENTRIES = Object.entries(out).filter(
|
||||||
(i) => !BLACKLIST.find(j => i[1].includes(j))
|
(i) => !BLACKLIST.find(j => i[1].includes(j))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user