Skip to content

Commit

Permalink
fix: fix build script to work in docs.rs builds (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k authored Nov 9, 2024
1 parent 8049f52 commit a03d65e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/augurs-prophet/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,18 @@ fn copy_wasmstan() -> Result<(), Box<dyn std::error::Error>> {
}

fn handle_wasmstan() -> Result<(), Box<dyn std::error::Error>> {
let _result = Ok::<(), Box<dyn std::error::Error>>(());
#[cfg(feature = "wasmstan")]
copy_wasmstan()?;
let _result = copy_wasmstan();

if std::env::var("DOCS_RS").is_ok() {
// In docs.rs we won't have (or need) the wasmstan file in the current directory,
// so we should just create an empty one so the build doesn't fail.
create_empty_files(&["prophet-wasmstan.wasm"])?;
} else {
// Otherwise, fail the build if there was an error.
_result?;
}
Ok(())
}

Expand Down

0 comments on commit a03d65e

Please sign in to comment.