Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wasm): missing wasm package cache dir creation #298

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions wrappers/src/fdw/wasm_fdw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Wasm Foreign Data Wrapper

This is Wasm foreign data wrapper host, please visit each Wasm foreign data wrapper documentation.

## Changelog

| Version | Date | Notes |
| ------- | ---------- | ---------------------------------------------------- |
| 0.1.1 | 2024-07-05 | Fix missing wasm package cache dir issue |
| 0.1.0 | 2024-07-03 | Initial version |

6 changes: 5 additions & 1 deletion wrappers/src/fdw/wasm_fdw/wasm_fdw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ fn download_component(
// download component wasm from remote and save it to local cache
let resp = rt.block_on(reqwest::get(url))?;
let bytes = rt.block_on(resp.bytes())?;
if let Some(parent) = path.parent() {
// create all parent directories if they do not exist
fs::create_dir_all(parent)?;
}
fs::write(&path, bytes)?;
}

Expand All @@ -97,7 +101,7 @@ fn download_component(
}

#[wrappers_fdw(
version = "0.1.0",
version = "0.1.1",
author = "Supabase",
website = "https://github.com/supabase/wrappers/tree/main/wrappers/src/fdw/wasm_fdw",
error_type = "WasmFdwError"
Expand Down
Loading