Skip to content

Commit ba8390d

Browse files
committed
node: Create dump output directory if it doesn't exist
1 parent 0a0034c commit ba8390d

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

node/src/manager/commands/dump.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fs;
22
use std::sync::Arc;
33

4-
use graph::{bail, prelude::anyhow::Result};
4+
use graph::prelude::anyhow::Result;
55

66
use graph_store_postgres::{ConnectionPool, SubgraphStore};
77

@@ -13,15 +13,8 @@ pub async fn run(
1313
deployment: DeploymentSearch,
1414
directory: String,
1515
) -> Result<()> {
16+
fs::create_dir_all(&directory)?;
1617
let directory = fs::canonicalize(&directory)?;
17-
let stat = fs::metadata(&directory)?;
18-
19-
if !stat.is_dir() {
20-
bail!(
21-
"The path `{}` is not a directory",
22-
directory.to_string_lossy()
23-
);
24-
}
2518

2619
let loc = deployment.locate_unique(&primary_pool).await?;
2720

0 commit comments

Comments
 (0)