From 7b8bebdfffd1dac0ff10651e009a40019fb9bb4c Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Wed, 23 Oct 2024 18:56:39 +1100 Subject: [PATCH] temp: display wasm file path --- wrappers/src/fdw/wasm_fdw/wasm_fdw.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wrappers/src/fdw/wasm_fdw/wasm_fdw.rs b/wrappers/src/fdw/wasm_fdw/wasm_fdw.rs index 6aa830e4..179127e7 100644 --- a/wrappers/src/fdw/wasm_fdw/wasm_fdw.rs +++ b/wrappers/src/fdw/wasm_fdw/wasm_fdw.rs @@ -43,15 +43,17 @@ fn download_component( version: &str, checksum: Option<&str>, ) -> WasmFdwResult { - if let Some(file_path) = url.strip_prefix("file://") { - return Ok(Component::from_file(engine, file_path)?); - } - report_info(&format!( "==curr dir {}", std::env::current_dir().unwrap().display() )); + report_info(&format!("==url {}", url)); + + if let Some(file_path) = url.strip_prefix("file://") { + return Ok(Component::from_file(engine, file_path)?); + } + if url.starts_with("warg://") || url.starts_with("wargs://") { let url = url .replacen("warg://", "http://", 1) @@ -112,8 +114,6 @@ fn download_component( fs::write(&path, bytes)?; } - report_info(&format!("==path {}", path.display())); - Ok(Component::from_file(engine, &path).inspect_err(|_| { // remove the cache file if it cannot be loaded as component let _ = fs::remove_file(&path);