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 2024/11/28 17:37:14 UTC
(camel) branch camel-4.8.x updated: CAMEL-21487: camel-jbang - Should be able to load route template files
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-4.8.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.8.x by this push:
new 28921e6f663 CAMEL-21487: camel-jbang - Should be able to load route template files
28921e6f663 is described below
commit 28921e6f663e918ccfb78a527cae998fca65e542
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Nov 28 18:36:58 2024 +0100
CAMEL-21487: camel-jbang - Should be able to load route template files
---
.../main/java/org/apache/camel/dsl/jbang/core/commands/Run.java | 7 +++++--
1 file changed, 5 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 2d0776b8b14..3ddaa5e4d8c 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
@@ -1576,10 +1576,13 @@ public class Run extends CamelCommand {
}
return ACCEPTED_XML_ROOT_ELEMENTS.contains(info.getRootElementName());
} else {
- // also support Camel K integrations and Pipes. And KameletBinding for backward compatibility
- return source.content().contains("- from:") || source.content().contains("- route:")
+ // TODO: we probably need a way to parse the content and match against the YAML DSL expected by Camel
+ // This check looks very fragile
+ return source.content().contains("from:") || source.content().contains("- from:")
+ || source.content().contains("- route:")
|| source.content().contains("- route-configuration:")
|| source.content().contains("- rest:") || source.content().contains("- beans:")
+ // also support Camel K integrations and Pipes. And KameletBinding for backward compatibility
|| source.content().contains("KameletBinding")
|| source.content().contains("Pipe")
|| source.content().contains("kind: Integration");