File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl BuildArgs {
9494 let path = if joined. exists ( ) { & joined } else { path } ;
9595 files. extend ( source_files_iter ( path, MultiCompilerLanguage :: FILE_EXTENSIONS ) ) ;
9696 }
97+ if files. is_empty ( ) {
98+ eyre:: bail!( "No source files found in specified build paths." )
99+ }
97100 }
98101
99102 let format_json = shell:: is_json ( ) ;
Original file line number Diff line number Diff line change @@ -2829,7 +2829,7 @@ Compiler run successful!
28292829"# ] ] ) ;
28302830
28312831 // Expect compilation to be skipped as no files have changed
2832- cmd. arg( "build" ) . assert_success( ) . stdout_eq( str ![ [ r#"
2832+ cmd. forge_fuse ( ) . arg( "build" ) . assert_success( ) . stdout_eq( str ![ [ r#"
28332833No files changed, compilation skipped
28342834
28352835"# ] ] ) ;
@@ -2952,6 +2952,14 @@ Compiler run successful!
29522952[SOLC_VERSION] [ELAPSED]
29532953Compiler run successful!
29542954
2955+ "# ] ] ) ;
2956+
2957+ // Fail if no source file found.
2958+ prj. clear( ) ;
2959+ cmd. forge_fuse( ) ;
2960+ cmd. args( [ "build" , "test/Dummy.sol" , "--force" ] ) . assert_failure( ) . stderr_eq( str ![ [ r#"
2961+ Error: No source files found in specified build paths.
2962+
29552963"# ] ] ) ;
29562964} ) ;
29572965
You can’t perform that action at this time.
0 commit comments