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 bug with deps array #22

Merged
merged 1 commit into from
Aug 17, 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: 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
Loading