camel git commit: Only run in the right directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

camel git commit: Only run in the right directory

davsclaus-2
Repository: camel
Updated Branches:
  refs/heads/master 3fa2f05d2 -> 1d288e080


Only run in the right directory


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1d288e08
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1d288e08
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1d288e08

Branch: refs/heads/master
Commit: 1d288e0802839fcfaa335e9d6a3087b396dc1993
Parents: 3fa2f05
Author: Claus Ibsen <[hidden email]>
Authored: Fri Feb 17 13:22:49 2017 +0100
Committer: Claus Ibsen <[hidden email]>
Committed: Fri Feb 17 13:22:49 2017 +0100

----------------------------------------------------------------------
 .../org/apache/camel/maven/packaging/PrepareExampleMojo.java   | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1d288e08/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareExampleMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareExampleMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareExampleMojo.java
index 5e05acd..ca56721 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareExampleMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareExampleMojo.java
@@ -80,6 +80,12 @@ public class PrepareExampleMojo extends AbstractMojo {
         Set<File> examples = new TreeSet<>();
 
         File dir = new File(".");
+
+        // only run in examples directory where the main readme.adoc file is located
+        if (!dir.getName().equals("examples")) {
+            return;
+        }
+
         File[] files = dir.listFiles();
         if (files != null) {
             examples.addAll(Arrays.asList(files));