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
99
99
// As a result, we have some special logic to remove readonly files on windows.
100
100
// This is also the reason that we can't use things like fs::remove_dir_all().
101
101
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 ( ) ;
103
104
p. set_readonly ( false ) ;
104
105
t ! ( fs:: set_permissions( path, p) ) ;
105
106
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
108
108
#[ 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 ( ) {
111
110
return ;
112
111
}
113
112
panic ! ( "failed to {} {}: {}" , desc, path. display( ) , e) ;
You can’t perform that action at this time.
0 commit comments