You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/12/01 15:28:36 UTC

[camel] branch main updated: CAMEL-17256: camel-jbang - Allow to run multiple files using wildcards. Detect properties files from the list of run files.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e9649ff  CAMEL-17256: camel-jbang - Allow to run multiple files using wildcards. Detect properties files from the list of run files.
e9649ff is described below

commit e9649ffa4c4b124daeb35b501d5087b0d36b8575
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 1 16:27:00 2021 +0100

    CAMEL-17256: camel-jbang - Allow to run multiple files using wildcards. Detect properties files from the list of run files.
---
 .../org/apache/camel/dsl/jbang/core/commands/Run.java    | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index ef3b6f2..9c90b9f 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -29,6 +29,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.dsl.jbang.core.common.RuntimeUtil;
 import org.apache.camel.main.KameletMain;
 import org.apache.camel.support.ResourceHelper;
+import org.apache.camel.util.ObjectHelper;
 import picocli.CommandLine.Command;
 import picocli.CommandLine.Option;
 import picocli.CommandLine.Parameters;
@@ -154,12 +155,23 @@ class Run implements Callable<Integer> {
         StringJoiner js = new StringJoiner(",");
         StringJoiner sjReload = new StringJoiner(",");
         for (String file : files) {
+            // check for properties files
+            if (file.endsWith(".properties")) {
+                if (ObjectHelper.isEmpty(propertiesFiles)) {
+                    propertiesFiles = file;
+                } else {
+                    propertiesFiles = propertiesFiles + "," + file;
+                }
+                continue;
+            }
+
+            // Camel DSL files
+
             if (!ResourceHelper.hasScheme(file) && !file.startsWith("github:")) {
                 file = "file:" + file;
             }
-
-            // check if file exist
             if (file.startsWith("file:")) {
+                // check if file exist
                 File inputFile = new File(file.substring(5));
                 if (!inputFile.exists() && !inputFile.isFile()) {
                     System.err.println("File does not exist: " + files);