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 2025/07/24 09:37:46 UTC

(camel) branch il created (now 98adfa6600c)

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

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


      at 98adfa6600c CAMEL-22267: camel-jbang - camel infra run xxx should create log dir if missing

This branch includes the following new commits:

     new 98adfa6600c CAMEL-22267: camel-jbang - camel infra run xxx should create log dir if missing

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: CAMEL-22267: camel-jbang - camel infra run xxx should create log dir if missing

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 98adfa6600cb5fcb280a8635b7fee35c947269de
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jul 24 11:37:28 2025 +0200

    CAMEL-22267: camel-jbang - camel infra run xxx should create log dir if missing
---
 .../src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java   | 2 ++
 .../java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

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 328d16bf4d8..a7a54a0e398 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
@@ -1469,6 +1469,8 @@ public class Run extends CamelCommand {
             // store background output in a log file to capture any error on startup
             logPath = getRunBackgroundLogFile("" + new Random().nextLong());
             try {
+                Path logDir = CommandLineHelper.getCamelDir();
+                Files.createDirectories(logDir); //make sure the parent dir exists
                 Files.createFile(logPath);
                 logPath.toFile().deleteOnExit();
             } catch (IOException e) {
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java
index ee22b4f6a2b..d78c97901a8 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java
@@ -182,7 +182,9 @@ public class InfraRun extends InfraBaseCommand {
     }
 
     private static Path createFile(String name) throws IOException {
-        Path logFile = CommandLineHelper.getCamelDir().resolve(name);
+        Path logDir = CommandLineHelper.getCamelDir();
+        Files.createDirectories(logDir); //make sure the parent dir exists
+        Path logFile = logDir.resolve(name);
         Files.createFile(logFile);
         return logFile;
     }