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 9df896a52b6 CAMEL-21431: camel-jbang - camel run can now use . instead
of * to select all files. (#16289)
9df896a52b6 is described below
commit 9df896a52b666143c292db804e28c1c8bb2b31c9
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 15 11:41:51 2024 +0100
CAMEL-21431: camel-jbang - camel run can now use . instead of * to select
all files. (#16289)
---
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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 daa8bfcc048..eb65e3797f9 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
@@ -415,6 +415,20 @@ public class Run extends CamelCommand {
return 1;
}
+ // special if user type: camel run .
+ if (sourceDir == null && (files != null && files.size() == 1 &&
".".equals(files.get(0)))) {
+ files.clear();
+ File[] fs = new File(".").listFiles();
+ if (fs != null && fs.length > 0) {
+ for (File f : fs) {
+ // skip hidden files
+ if (f.isFile() && !f.isHidden()) {
+ files.add(f.getName());
+ }
+ }
+ }
+ }
+
if (RuntimeType.quarkus == runtime) {
return runQuarkus();
} else if (RuntimeType.springBoot == runtime) {