File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,16 @@ pub async fn update_compilation_file(root: &path::PathBuf) -> Result<()> {
109109 use crate :: xcode:: fresh_build;
110110 use tokio_stream:: StreamExt ;
111111
112- let steps = fresh_build ( & root) . await ?. collect :: < Vec < Step > > ( ) . await ;
113112 // TODO(build): Ensure that build successed. check for Exit Code
114- let json = generate_from_steps ( & steps)
115- . await ?
116- . pipe ( |cmd| serde_json:: to_vec_pretty ( & cmd. 0 ) ) ?;
113+ let steps = fresh_build ( & root) . await ?. collect :: < Vec < Step > > ( ) . await ;
114+ let compile_commands = steps. pipe_ref ( generate_from_steps) . await ?;
115+ if compile_commands. is_empty ( ) {
116+ let msg = format ! ( "No compile commands generated\n {:#?}" , steps) ;
117+ anyhow:: bail!( "{msg}" )
118+ }
117119
118- tokio:: fs:: write ( root. join ( ".compile" ) , json)
119- . await
120- . context ( "Write CompileCommands" ) ?;
120+ let json = serde_json:: to_vec_pretty ( & compile_commands) ?;
121+ tokio:: fs:: write ( root. join ( ".compile" ) , & json) . await ?;
121122
122123 Ok ( ( ) )
123124}
You can’t perform that action at this time.
0 commit comments