File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -99,15 +99,14 @@ where
9999 // As a result, we have some special logic to remove readonly files on windows.
100100 // This is also the reason that we can't use things like fs::remove_dir_all().
101101 Err ( ref e) if cfg ! ( windows) && e. kind ( ) == ErrorKind :: PermissionDenied => {
102- let mut p = t ! ( path. symlink_metadata( ) ) . permissions ( ) ;
102+ let m = t ! ( path. symlink_metadata( ) ) ;
103+ let mut p = m. permissions ( ) ;
103104 p. set_readonly ( false ) ;
104105 t ! ( fs:: set_permissions( path, p) ) ;
105106 f ( path) . unwrap_or_else ( |e| {
106- // Deleting symlinked directories on Windows is non-trivial.
107- // Skip doing so for now.
107+ // Delete symlinked directories on Windows
108108 #[ cfg( windows) ]
109- if e. kind ( ) == ErrorKind :: PermissionDenied && path. is_dir ( ) {
110- eprintln ! ( "warning: failed to delete '{}'." , path. display( ) ) ;
109+ if m. file_type ( ) . is_symlink ( ) && path. is_dir ( ) && fs:: remove_dir ( path) . is_ok ( ) {
111110 return ;
112111 }
113112 panic ! ( "failed to {} {}: {}" , desc, path. display( ) , e) ;
You can’t perform that action at this time.
0 commit comments