2024-01-25 14:19:09 +00:00
|
|
|
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();
|
2024-01-25 14:19:09 +00:00
|
|
|
|
|
|
|
deleteFile(config.database.dbPath);
|
|
|
|
};
|
|
|
|
|
2024-02-22 05:45:17 +00:00
|
|
|
main().catch((err) => log(err));
|