File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
use std:: ffi:: OsStr ;
2
- use std:: fs;
3
2
use std:: hash:: { Hash , Hasher } ;
4
3
use std:: path:: { Path , PathBuf } ;
5
4
use std:: process:: Command ;
5
+ use std:: { fs, io} ;
6
6
7
7
use crate :: path:: { Dirs , RelPath } ;
8
8
use crate :: utils:: { copy_dir_recursively, ensure_empty_dir, spawn_and_wait} ;
@@ -155,6 +155,13 @@ impl GitRepo {
155
155
156
156
fn clone_repo ( download_dir : & Path , repo : & str , rev : & str ) {
157
157
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
+
158
165
// Ignore exit code as the repo may already have been checked out
159
166
git_command ( None , "clone" ) . arg ( repo) . arg ( download_dir) . spawn ( ) . unwrap ( ) . wait ( ) . unwrap ( ) ;
160
167
You can’t perform that action at this time.
0 commit comments