rmdir directories
authorDobrica Pavlinusic <dpavlin@rsync1>
Sun, 20 Nov 2011 21:39:59 +0000 (22:39 +0100)
committerDobrica Pavlinusic <dpavlin@rsync1>
Sun, 20 Nov 2011 21:39:59 +0000 (22:39 +0100)
lib/CloudStore/Store.pm

index 2e27727..9ae48ac 100644 (file)
@@ -90,7 +90,7 @@ sub modify_file {
                                my $path = $self->blob_path($data => $from_dir . $1 );
                                if ( -e $path ) {
                                        warn "UNLINK $path";
-                                       unlink $path || warn "ERROR: unlink $path $!";
+                                       -d $path ? rmdir $path : unlink $path || warn "ERROR: unlink $path $!";
                                        next;
                                } else {
                                        warn "MISSING $path to unlink";