Skip to content

Commit

Permalink
tests: initSimnet handles absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Jan 24, 2025
1 parent 39560e0 commit ccdfa24
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
35 changes: 20 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/clarinet-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ serde-wasm-bindgen = { version = "0.6.4", optional = true }
wasm-bindgen = { workspace = true, optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
serde_json = "1.0.114"
web-sys = "0.3.77"

[features]
default = ["cli"]
Expand Down
5 changes: 4 additions & 1 deletion components/clarinet-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@ impl FileLocation {
path.extend(&path_to_append);
}
FileLocation::Url { url } => {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("url: {}", url).into());

let mut paths_segments = url
.path_segments_mut()
.map_err(|_| "unable to mutate url".to_string())?;
.map_err(|_| "unable to mutate url")?;
for component in path_to_append.components() {
let segment = component
.as_os_str()
Expand Down

0 comments on commit ccdfa24

Please sign in to comment.