Skip to content

Commit

Permalink
fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
rmpestano committed Mar 9, 2018
1 parent 7ca4b23 commit da849b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@ public String getIconFileName() {


public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
DirectoryBrowserSupport dbs = new DirectoryBrowserSupport(this, new FilePath(dir()), getTitle(), getUrlName(),

boolean hasDoctypeParam = req.hasParameter("doctype");

String dir = dir().getPath();
if(hasDoctypeParam) {
dir = dir.substring(0,dir.lastIndexOf("/"));
}

DirectoryBrowserSupport dbs = new DirectoryBrowserSupport(this, new FilePath(new File(dir)), getTitle(), getUrlName(),
false);

if (req.hasParameter("doctype")) {
if (hasDoctypeParam) {
String docType = req.getParameter("doctype").toLowerCase();
if (docType.equals("html")) {
dbs.setIndexFileName(HTML_DOCS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, Task
documentationLink = "../" + CukedoctorBaseAction.BASE_URL + "/";
pool.execute(runAll(features, documentAttributes, cukedoctorConfig, outputPath));
} else {
documentationLink = "../" + build.getNumber() + "/" + CukedoctorBaseAction.BASE_URL + "/documentation." + format.getFormat();
documentationLink = "../" + build.getNumber() + "/" + CukedoctorBaseAction.BASE_URL + "?doctype=" + format.getFormat();
pool.execute(run(features, documentAttributes, cukedoctorConfig, outputPath));
}

Expand Down

0 comments on commit da849b7

Please sign in to comment.