snowballtools-base/packages/backend/test/delete-db.ts
2024-10-03 11:34:08 +05:30

20 lines
420 B
TypeScript

import * as fs from 'fs/promises';
import debug from 'debug';
import { getConfig } from '../src/utils';
const log = debug('snowball:delete-database');
const deleteFile = async (filePath: string) => {
await fs.unlink(filePath);
log(`File ${filePath} has been deleted.`);
};
const main = async () => {
const config = await getConfig();
deleteFile(config.database.dbPath);
};
main().catch((err) => log(err));