mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(cli): don't init datadir if it doesn't exist in db command (#9264)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -67,6 +67,16 @@ impl Command {
|
||||
let db_path = data_dir.db();
|
||||
let static_files_path = data_dir.static_files();
|
||||
|
||||
// ensure the provided datadir exist
|
||||
eyre::ensure!(
|
||||
data_dir.data_dir().is_dir(),
|
||||
"Datadir does not exist: {:?}",
|
||||
data_dir.data_dir()
|
||||
);
|
||||
|
||||
// ensure the provided database exist
|
||||
eyre::ensure!(db_path.is_dir(), "Database does not exist: {:?}", db_path);
|
||||
|
||||
match self.command {
|
||||
// TODO: We'll need to add this on the DB trait.
|
||||
Subcommands::Stats(command) => {
|
||||
|
||||
Reference in New Issue
Block a user