Skip to content

Commit 58af758

Browse files
authored
Merge pull request #298 from supabase/bo/fix/wasm-cache
fix(wasm): missing wasm package cache dir creation
2 parents 504a40f + af8fea9 commit 58af758

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

wrappers/src/fdw/wasm_fdw/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Wasm Foreign Data Wrapper
2+
3+
This is Wasm foreign data wrapper host, please visit each Wasm foreign data wrapper documentation.
4+
5+
## Changelog
6+
7+
| Version | Date | Notes |
8+
| ------- | ---------- | ---------------------------------------------------- |
9+
| 0.1.1 | 2024-07-05 | Fix missing wasm package cache dir issue |
10+
| 0.1.0 | 2024-07-03 | Initial version |
11+

wrappers/src/fdw/wasm_fdw/wasm_fdw.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ fn download_component(
8686
// download component wasm from remote and save it to local cache
8787
let resp = rt.block_on(reqwest::get(url))?;
8888
let bytes = rt.block_on(resp.bytes())?;
89+
if let Some(parent) = path.parent() {
90+
// create all parent directories if they do not exist
91+
fs::create_dir_all(parent)?;
92+
}
8993
fs::write(&path, bytes)?;
9094
}
9195

@@ -97,7 +101,7 @@ fn download_component(
97101
}
98102

99103
#[wrappers_fdw(
100-
version = "0.1.0",
104+
version = "0.1.1",
101105
author = "Supabase",
102106
website = "https://github.com/supabase/wrappers/tree/main/wrappers/src/fdw/wasm_fdw",
103107
error_type = "WasmFdwError"

0 commit comments

Comments
 (0)