Skip to content

Commit f0f2317

Browse files
committed
Error if generating bindings for non-existent component
Signed-off-by: itowlson <[email protected]>
1 parent a82f388 commit f0f2317

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/commands/bindings.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ impl GenerateBindingsCommand {
3434
.join(SPIN_DEPS_WIT_FILE_NAME);
3535

3636
if !std::fs::exists(&wit_path)? {
37-
// TODO: warn that the file does not exist
38-
return Ok(());
37+
anyhow::bail!(
38+
r#"The WIT file that `spin deps` uses to track component dependencies doesn't exist. This can happen if:
39+
* the component name is incorrect
40+
* you've not previously run `spin deps add` for this component
41+
The expected file is {wit_path:?}"#
42+
);
3943
}
4044

4145
let mut resolve = Resolve::default();

0 commit comments

Comments
 (0)