From 7befc0df20149161018f1ff06a879366831c45fa Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 23 Apr 2022 11:55:05 +0200 Subject: Dedupper --- includes/fetcher/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'includes/fetcher/index.js') diff --git a/includes/fetcher/index.js b/includes/fetcher/index.js index 4d1dbbf..43357c8 100644 --- a/includes/fetcher/index.js +++ b/includes/fetcher/index.js @@ -213,6 +213,16 @@ console.log("Done fetching, found " + Object.keys(projects).length + " projects"); } + let known = []; + fs.writeFileSync("./projects.json", JSON.stringify(JSON.parse(fs.readFileSync('./projects.json').toString()).map((i) => { + if (!known.includes(i.gitlab_id)) { + known.push(i.gitlab_id); + return i; + } else { + return null; + } + }).filter(i => i !== null), null, 4)); + if (fs.existsSync("personal")) fs.rmSync("personal", { recursive: true }) console.log("Cloning minteck/minteck from GitHub..."); cp.execSync("git clone https://github.com/minteck/minteck personal"); -- cgit