Skip to content

Commit

Permalink
Fix bug with deps array (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgb authored Aug 17, 2024
1 parent 80d7609 commit 7eddb0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion stateroom-cli/src/build_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ pub fn run_cargo_build_command(
.extension()
.map_or(false, |ext| ext.to_ascii_lowercase() == "wasm")
{
if filename.parent().map_or(false, |p| p.ends_with("deps")) {
continue;
}

found_wasm_modules.push(filename);
}
}
Expand All @@ -79,7 +83,12 @@ pub fn run_cargo_build_command(
let result = match found_wasm_modules.as_slice() {
[] => return Err(anyhow!("No .wasm files emitted by build.")),
[a] => a,
_ => return Err(anyhow!("Multiple .wasm files emitted by build.")),
files => {
return Err(anyhow!(
"Multiple .wasm files emitted by build ({:?}).",
files
))
}
};

Ok(result.into())
Expand Down
4 changes: 3 additions & 1 deletion stateroom-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ async fn handle_socket(mut socket: WebSocket, state: Arc<ServerState>) {
msg = socket.recv() => {
match msg {
Some(Ok(msg)) => send.send(Event::Message { client: client_id, message: msg }).await.unwrap(),
Some(Err(_)) => todo!("Error receiving message from client."),
Some(Err(err)) => {
tracing::warn!(?err, "Error receiving message from client.");
},
None => break,
}
}
Expand Down

0 comments on commit 7eddb0e

Please sign in to comment.