File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl BuildArgs {
94
94
let path = if joined. exists ( ) { & joined } else { path } ;
95
95
files. extend ( source_files_iter ( path, MultiCompilerLanguage :: FILE_EXTENSIONS ) ) ;
96
96
}
97
+ if files. is_empty ( ) {
98
+ eyre:: bail!( "No source files found in specified build paths." )
99
+ }
97
100
}
98
101
99
102
let format_json = shell:: is_json ( ) ;
Original file line number Diff line number Diff line change @@ -2829,7 +2829,7 @@ Compiler run successful!
2829
2829
"# ] ] ) ;
2830
2830
2831
2831
// 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#"
2833
2833
No files changed, compilation skipped
2834
2834
2835
2835
"# ] ] ) ;
@@ -2952,6 +2952,14 @@ Compiler run successful!
2952
2952
[SOLC_VERSION] [ELAPSED]
2953
2953
Compiler run successful!
2954
2954
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
+
2955
2963
"# ] ] ) ;
2956
2964
} ) ;
2957
2965
You can’t perform that action at this time.
0 commit comments