From 89641335c207fc431246322a870ff3f8928d99b0 Mon Sep 17 00:00:00 2001 From: Igor Dejanovic Date: Tue, 31 Oct 2023 21:22:14 +0100 Subject: [PATCH] fix: local_file! getting of workspace dir --- rustemo-compiler/src/utils.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rustemo-compiler/src/utils.rs b/rustemo-compiler/src/utils.rs index 07f84fa5..ac3db589 100644 --- a/rustemo-compiler/src/utils.rs +++ b/rustemo-compiler/src/utils.rs @@ -67,9 +67,11 @@ pub use output_cmp; #[macro_export] macro_rules! local_file { ($this:expr, $local_path:expr) => { - &std::path::PathBuf::from(env!("CARGO_WORKSPACE_DIR")) - .join($this) - .with_file_name($local_path) + &std::path::PathBuf::from( + std::env::var("CARGO_WORKSPACE_DIR").unwrap_or(".".to_string()), + ) + .join($this) + .with_file_name($local_path) }; } pub use local_file;