@@ -68,7 +68,7 @@ impl ComponentSource {
6868
6969 if let Ok ( ( name, version) ) = package_name_ver ( source) {
7070 if version. is_none ( ) {
71- bail ! ( "Version needs to specified for regitry sources." )
71+ bail ! ( "Version needs to specified for registry sources." )
7272 }
7373 return Ok ( Self :: Registry ( RegistryAddCommand {
7474 package : name,
@@ -96,6 +96,8 @@ impl AddCommand {
9696
9797 let ( mut resolve, main) = parse_component_bytes ( component) ?;
9898
99+ let selected_interfaces = self . select_interfaces ( & mut resolve, main) ?;
100+
99101 let mut manifest = manifest_from_file ( get_spin_manifest_path ( ) ?) ?;
100102 let component_ids = get_component_ids ( & manifest) ;
101103 let selected_component_index = select_prompt (
@@ -105,8 +107,6 @@ impl AddCommand {
105107 ) ?;
106108 let selected_component = & component_ids[ selected_component_index] ;
107109
108- let selected_interfaces = self . select_interfaces ( & mut resolve, main) ?;
109-
110110 resolve. importize (
111111 resolve. select_world ( main, None ) ?,
112112 Some ( "dependency-world" . to_string ( ) ) ,
@@ -143,6 +143,10 @@ impl AddCommand {
143143 let world_id = resolve. select_world ( main, None ) ?;
144144 let exported_interfaces = get_exported_interfaces ( resolve, world_id) ;
145145
146+ if exported_interfaces. is_empty ( ) {
147+ bail ! ( "No exported interfaces found in the component" )
148+ } ;
149+
146150 let mut package_interface_map: HashMap < String , Vec < String > > = HashMap :: new ( ) ;
147151 let mut selected_interfaces: Vec < String > = Vec :: new ( ) ;
148152
0 commit comments