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;
44use itertools:: Itertools ;
55use std:: ffi:: OsStr ;
66use std:: fs;
7+ use std:: path:: Path ;
78use std:: process:: Command ;
89use tracing:: info;
910
@@ -58,9 +59,18 @@ fn set_sources(config: &mut Config) -> anyhow::Result<()> {
5859 Ok ( ( ) )
5960}
6061
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+
6170pub ( crate ) fn prepare ( config : & mut Config ) -> anyhow:: Result < ( ) > {
6271 dump_lib ( ) ?;
6372 set_sources ( config) ?;
73+ remove_file_if_exists ( Path :: new ( "Cargo.lock" ) ) ?;
6474 dump_cargo_manifest ( & config. qltest_dependencies ) ?;
6575 if config. qltest_cargo_check {
6676 let status = Command :: new ( "cargo" )
You can’t perform that action at this time.
0 commit comments