File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11use std:: ffi:: OsStr ;
2- use std:: fs;
32use std:: hash:: { Hash , Hasher } ;
43use std:: path:: { Path , PathBuf } ;
54use std:: process:: Command ;
5+ use std:: { fs, io} ;
66
77use crate :: path:: { Dirs , RelPath } ;
88use crate :: utils:: { copy_dir_recursively, ensure_empty_dir, spawn_and_wait} ;
@@ -155,6 +155,13 @@ impl GitRepo {
155155
156156fn clone_repo ( download_dir : & Path , repo : & str , rev : & str ) {
157157 eprintln ! ( "[CLONE] {}" , repo) ;
158+
159+ match fs:: remove_dir_all ( download_dir) {
160+ Ok ( ( ) ) => { }
161+ Err ( err) if err. kind ( ) == io:: ErrorKind :: NotFound => { }
162+ Err ( err) => panic ! ( "Failed to remove {path}: {err}" , path = download_dir. display( ) ) ,
163+ }
164+
158165 // Ignore exit code as the repo may already have been checked out
159166 git_command ( None , "clone" ) . arg ( repo) . arg ( download_dir) . spawn ( ) . unwrap ( ) . wait ( ) . unwrap ( ) ;
160167
You can’t perform that action at this time.
0 commit comments