From b5c0f0c23a5377d3a77f771140a1b330c0b97ca8 Mon Sep 17 00:00:00 2001 From: Chandra Penke Date: Thu, 29 Feb 2024 11:18:12 -0800 Subject: [PATCH] fix: attempt at canonicalizing a path --- rust/candid_parser/src/typing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/candid_parser/src/typing.rs b/rust/candid_parser/src/typing.rs index 807f3690..7cc0dc0f 100644 --- a/rust/candid_parser/src/typing.rs +++ b/rust/candid_parser/src/typing.rs @@ -202,13 +202,13 @@ fn check_actor(env: &Env, actor: &Option) -> Result> { } } -fn resolve_path(base: &Path, file: &str) -> PathBuf { +fn resolve_path(base: &Path, file_str: &str) -> PathBuf { // TODO use shellexpand to support tilde - let file = PathBuf::from(file); + let file = PathBuf::from(file_str); if file.is_absolute() { file } else { - base.join(file) + std::fs::canonicalize(base.join(file)).expect(&format!("cannot canonicalize {file_str}")) } }