Skip to content

Commit

Permalink
Expose version info in nemo-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
rlwww authored and mmarx committed Nov 7, 2023
1 parent 95c4a02 commit c8e83ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build]
# See https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
# Required for https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.FileSystemSyncAccessHandle.html
rustflags = ["--cfg=web_sys_unstable_apis"]
5 changes: 5 additions & 0 deletions nemo-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,8 @@ fn custom_alloc_error_hook(layout: Layout) {
pub fn set_alloc_error_hook() {
std::alloc::set_alloc_error_hook(custom_alloc_error_hook);
}

#[wasm_bindgen(js_name = "getNemoVersion")]
pub fn nemo_version() -> Option<String> {
option_env!("CARGO_PKG_VERSION").map(|version| version.into())
}

0 comments on commit c8e83ff

Please sign in to comment.