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 77ad3d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions components/clarinet-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ 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 = { workspace = true, features = ["console"], optional = true }


[features]
default = ["cli"]
cli = ["bitcoin", "clarity-repl/sdk"]
wasm = [
"js-sys",
# "web-sys",
"serde-wasm-bindgen",
"wasm-bindgen",
"wasm-bindgen-futures",
Expand Down
8 changes: 7 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 Expand Up @@ -264,6 +267,9 @@ impl FileLocation {
path.pop();
}
FileLocation::Url { url } => {
// #[cfg(target_arch = "wasm32")]
// web_sys::console::log_1(&format!("url: {}", url).into());

let mut segments = url
.path_segments_mut()
.map_err(|_| "unable to mutate url".to_string())?;
Expand Down

0 comments on commit 77ad3d9

Please sign in to comment.