Skip to content

Commit

Permalink
Strip trailing slashes in exportDir #62
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuss committed Dec 5, 2014
1 parent 9898440 commit 0db828d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public String content() {
}

// Volume export
if (!"/".equalsIgnoreCase(exportDir)) {
if (exportDir.length() > 0) {
// Dont export a top level export dir
b.append("VOLUME [\"").append(exportDir).append("\"]\n");
}
Expand Down Expand Up @@ -123,9 +123,13 @@ public DockerFileBuilder maintainer(String maintainer) {
return this;
}

public DockerFileBuilder exportDir(String exportDir) {
if (exportDir != null) {
this.exportDir = exportDir;
public DockerFileBuilder exportDir(String dir) {
if (dir != null) {
exportDir = dir;
// Strip trailing slashes
while (exportDir.endsWith("/")) {
exportDir = exportDir.substring(0,exportDir.length() - 1);
}
}
return this;
}
Expand Down

0 comments on commit 0db828d

Please sign in to comment.