File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use glob::glob;
4
4
use itertools:: Itertools ;
5
5
use std:: ffi:: OsStr ;
6
6
use std:: fs;
7
+ use std:: path:: Path ;
7
8
use std:: process:: Command ;
8
9
use tracing:: info;
9
10
@@ -58,9 +59,18 @@ fn set_sources(config: &mut Config) -> anyhow::Result<()> {
58
59
Ok ( ( ) )
59
60
}
60
61
62
+ fn remove_file_if_exists ( path : & Path ) -> anyhow:: Result < ( ) > {
63
+ match fs:: remove_file ( path) {
64
+ Err ( e) if e. kind ( ) == std:: io:: ErrorKind :: NotFound => Ok ( ( ) ) ,
65
+ x => x,
66
+ }
67
+ . context ( format ! ( "removing file {}" , path. display( ) ) )
68
+ }
69
+
61
70
pub ( crate ) fn prepare ( config : & mut Config ) -> anyhow:: Result < ( ) > {
62
71
dump_lib ( ) ?;
63
72
set_sources ( config) ?;
73
+ remove_file_if_exists ( Path :: new ( "Cargo.lock" ) ) ?;
64
74
dump_cargo_manifest ( & config. qltest_dependencies ) ?;
65
75
if config. qltest_cargo_check {
66
76
let status = Command :: new ( "cargo" )
You can’t perform that action at this time.
0 commit comments