mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-12-23 05:07:44 +00:00
22 lines
551 B
TypeScript
22 lines
551 B
TypeScript
|
import * as fs from 'fs/promises';
|
||
|
import debug from 'debug';
|
||
|
|
||
|
import { getConfig } from '../src/utils';
|
||
|
import { Config } from '../src/config';
|
||
|
import { DEFAULT_CONFIG_FILE_PATH } from '../src/constants';
|
||
|
|
||
|
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<Config>(DEFAULT_CONFIG_FILE_PATH);
|
||
|
|
||
|
deleteFile(config.database.dbPath);
|
||
|
};
|
||
|
|
||
|
main().catch(err => log(err));
|