Skip to content

Commit

Permalink
fix: local_file! getting of workspace dir
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Oct 31, 2023
1 parent 76b5ac0 commit 8964133
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rustemo-compiler/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 8964133

Please sign in to comment.