Skip to content

Commit

Permalink
Fix JENKINS-15059
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Sep 6, 2012
1 parent b67246d commit 1710ef6
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -214,9 +214,15 @@ public void onDeleted(AbstractBuild build) {
remoteArtifactPath.deleteRecursive();
}

if (remoteArtifactPath.getParent().exists() && remoteArtifactPath.getParent().list().size() == 0) {
remoteArtifactPath.getParent().delete();
}
FilePath parent = remoteArtifactPath.getParent();
boolean rest;
do {
rest = parent.exists() && parent.list().size() == 0;
if (rest) {
parent.delete();
}
parent = parent.getParent();
} while (rest);

} catch (IOException ioe) {
logger.log(Level.SEVERE, "Error when deleting artifacts.", ioe);
Expand Down

0 comments on commit 1710ef6

Please sign in to comment.