From 8d7856f32e0552bdfc049e443302bbd795c720f2 Mon Sep 17 00:00:00 2001 From: Harvmaster Date: Mon, 4 May 2026 12:14:15 +0000 Subject: [PATCH] Remove scripts --- package.json | 2 - scripts/rm-dbs.ts | 40 -------------- scripts/template-to-json.ts | 104 ------------------------------------ 3 files changed, 146 deletions(-) delete mode 100644 scripts/rm-dbs.ts delete mode 100644 scripts/template-to-json.ts diff --git a/package.json b/package.json index 268d4c0..bdf7338 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,6 @@ "test": "vitest --run --passWithNoTests", "test:watch": "vitest", "test:coverage": "vitest run --coverage --passWithNoTests", - "nuke": "tsx scripts/rm-dbs.ts", - "nuke:dry": "tsx scripts/rm-dbs.ts --dry", "format": "prettier --write \"**/*.{js,ts,md,json}\" --ignore-path .gitignore", "format:check": "prettier --check .", "autocomplete:install": "node dist/cli/index.js completions bash --install", diff --git a/scripts/rm-dbs.ts b/scripts/rm-dbs.ts deleted file mode 100644 index 0ce2587..0000000 --- a/scripts/rm-dbs.ts +++ /dev/null @@ -1,40 +0,0 @@ -import fs from "fs/promises"; - -/** - * Remove all the databases without the use of external tools - * TODO: Fix the ts linking issue here. Should just be adding this as a dir in tsconfig.json - */ -const rmDbs = async (dry = false) => { - // First, we need to find all the database base files - // These end in either .db.sqlite, .sqlite, .db - // Get all the files in the current directory - const files = await fs.readdir("./"); - - // Filter out the files that end in .db.sqlite, .sqlite, .db - const dbFiles = files.filter( - (file) => - file.endsWith(".db.sqlite") || - file.endsWith(".sqlite") || - file.endsWith(".db"), - ); - - // We need to remove all the files - await deleteFiles(dbFiles, dry); -}; - -const deleteFiles = async (files: string[], dry = false) => { - if (dry) { - console.log("Dry run, would delete:", files); - return; - } - - await Promise.all(files.map((file) => fs.rm(file))); - console.log("All databases removed"); -}; - -// Read args -const args = process.argv.slice(2); -const dry = args.includes("--dry"); - -// Delete the files -await rmDbs(dry); diff --git a/scripts/template-to-json.ts b/scripts/template-to-json.ts deleted file mode 100644 index c528c4b..0000000 --- a/scripts/template-to-json.ts +++ /dev/null @@ -1,104 +0,0 @@ -import fs from "node:fs/promises"; -import path from "node:path"; -import { pathToFileURL } from "node:url"; - -/** - * This just convers the