snowballtools-base/packages/backend/test/delete-db.ts

20 lines
420 B
TypeScript
Raw Normal View History

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 () => {
2024-10-03 04:50:38 +00:00
const config = await getConfig();
deleteFile(config.database.dbPath);
};
main().catch((err) => log(err));