forked from cerc-io/snowballtools-base
Nabarun Gogoi
cfb4b4637c
* Fix deployment creation time and hard coded title * Add delete database script * Use database file path from config file --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
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));
|