Skip to content

Commit

Permalink
Fix slash in path for docs (#55)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless authored Jul 23, 2024
1 parent 3e61f9d commit 5045cf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dummy-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<goal>test-docs-generator</goal>
</goals>
<configuration>
<testsPath>./dummy-module/src/test/java/io/skodjob/</testsPath>
<testsPath>${project.basedir}/src/test/java/io/skodjob/</testsPath>
<docsPath>./docs/actual/option1/</docsPath>
<generateFmf>true</generateFmf>
<generateDirs>true</generateDirs>
Expand All @@ -112,7 +112,7 @@
<goal>test-docs-generator</goal>
</goals>
<configuration>
<testsPath>./dummy-module/src/test/java/io/skodjob/</testsPath>
<testsPath>${project.basedir}/src/test/java/io/skodjob/</testsPath>
<docsPath>./docs/actual/option2/</docsPath>
<generateFmf>true</generateFmf>
<generateDirs>false</generateDirs>
Expand All @@ -125,7 +125,7 @@
<goal>test-docs-generator</goal>
</goals>
<configuration>
<testsPath>./dummy-module/src/test/java/io/skodjob/</testsPath>
<testsPath>${project.basedir}/src/test/java/io/skodjob/</testsPath>
<docsPath>./docs/actual/option3/</docsPath>
<generateFmf>false</generateFmf>
<generateDirs>false</generateDirs>
Expand All @@ -138,7 +138,7 @@
<goal>test-docs-generator</goal>
</goals>
<configuration>
<testsPath>./dummy-module/src/test/java/io/skodjob/</testsPath>
<testsPath>${project.basedir}/src/test/java/io/skodjob/</testsPath>
<docsPath>./docs/actual/option4/</docsPath>
<generateFmf>false</generateFmf>
<generateDirs>true</generateDirs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public void execute() {
getLog().debug(url.getFile());
}

// Ensure that docsPath ends with /
if (!docsPath.endsWith("/")) {
docsPath += "/";
}

Map<String, String> classes = Utils.getTestClassesWithTheirPath(testsPath, generateDirs);
for (Map.Entry<String, String> entry : classes.entrySet()) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private static void updateLabelFile(String labelFilePath, String updatedData) {
* @param docsPath path where all test docs are stored
*/
public static void updateLinksInLabels(String docsPath) {
String labelsPath = docsPath + "/" + LABELS;
String labelsPath = docsPath + LABELS;

int numberOfDirs = docsPath.length() - docsPath.replace("/", "").length();
String mdFilesPath = "../".repeat(numberOfDirs);
Expand Down

0 comments on commit 5045cf3

Please sign in to comment.