From a984e8aa2e4a0fbe33f656d4d2a0d6317bd52495 Mon Sep 17 00:00:00 2001 From: Victor Porton Date: Mon, 15 Apr 2024 14:07:24 +0300 Subject: [PATCH] bug fix --- src/dfx/src/lib/builders/motoko.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dfx/src/lib/builders/motoko.rs b/src/dfx/src/lib/builders/motoko.rs index 0869819747..89b30bc47d 100644 --- a/src/dfx/src/lib/builders/motoko.rs +++ b/src/dfx/src/lib/builders/motoko.rs @@ -165,6 +165,13 @@ impl MotokoBuilder { } }; + std::fs::create_dir_all(motoko_info.get_output_root()).with_context(|| { + format!( + "Failed to create {}.", + motoko_info.get_output_root().to_string_lossy() + ) + })?; + let idl_dir_path = &config.idl_root; std::fs::create_dir_all(idl_dir_path) .with_context(|| format!("Failed to create {}.", idl_dir_path.to_string_lossy()))?; @@ -321,14 +328,7 @@ impl CanisterBuilder for MotokoBuilder { .map(|c| (c.canister_id().to_text(), c.get_name().to_string())) .collect(); - std::fs::create_dir_all(motoko_info.get_output_root()).with_context(|| { - format!( - "Failed to create {}.", - motoko_info.get_output_root().to_string_lossy() - ) - })?; let cache = &self.cache; - get_imports(cache.as_ref(), &motoko_info, &mut *pool.imports.borrow_mut(), pool)?; self.do_build(