From 482a7ecb61dfd81d03b3d91842012a40fd6f31fe Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 18 Jun 2025 19:57:36 +0200 Subject: [PATCH] Put session file into `out` dir --- binaries/cli/src/session.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/binaries/cli/src/session.rs b/binaries/cli/src/session.rs index 9311fded..9a8ac5b8 100644 --- a/binaries/cli/src/session.rs +++ b/binaries/cli/src/session.rs @@ -49,6 +49,9 @@ impl DataflowSession { .context("session file has no file name")? .to_str() .context("session file name is no utf8")?; + if let Some(parent) = session_file.parent() { + std::fs::create_dir_all(parent).context("failed to create out dir")?; + } std::fs::write(&session_file, self.serialize()?) .context("failed to write dataflow session file")?; let gitignore = session_file.with_file_name(".gitignore"); @@ -88,6 +91,8 @@ fn session_file_path(dataflow_path: &Path) -> eyre::Result { .wrap_err("dataflow path has no file stem")? .to_str() .wrap_err("dataflow file stem is not valid utf-8")?; - let session_file = dataflow_path.with_file_name(format!("{file_stem}.dora-session.yaml")); + let session_file = dataflow_path + .with_file_name("out") + .join(format!("{file_stem}.dora-session.yaml")); Ok(session_file) }