This is an automated email from the ASF dual-hosted git repository.
mgubaidullin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
The following commit(s) were added to refs/heads/main by this push:
new 46da5972 fix: omit JBang version option when Camel version is empty
(#1663)
46da5972 is described below
commit 46da59727977c0851228d39c267752cac059c266
Author: Bartosz Popiela <[email protected]>
AuthorDate: Mon Nov 9 20:58:13 2026 +0100
fix: omit JBang version option when Camel version is empty (#1663)
Co-authored-by: Bartosz Popiela <[email protected]>
Co-authored-by: Copilot <[email protected]>
---
karavan-vscode/AGENT.md | 1 +
karavan-vscode/README.md | 3 +++
karavan-vscode/package.json | 2 +-
karavan-vscode/src/jbang.ts | 6 +++---
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/karavan-vscode/AGENT.md b/karavan-vscode/AGENT.md
index efaedaa8..f4b92abc 100644
--- a/karavan-vscode/AGENT.md
+++ b/karavan-vscode/AGENT.md
@@ -195,6 +195,7 @@ line**. `${NAMESPACE}` and `${DATE}` are resolved later as
**terminal env vars**
value `.export`. `readCamelYamlFiles()` filters exported copies out of the
file list.
- **JBang command shape** (`jbang.prepareCommand`):
`jbang "-Dcamel.jbang.version=<camel.version>" camel@apache/camel <cmd>`.
+ The version option is omitted when `camel.version` is unset, empty, or
whitespace-only.
- **Run** = `run * [--max-messages=N] [--local-kamelet-dir=…] [--dev]`.
**Export** = `export --fresh --directory=<path> [--local-kamelet-dir=…]`.
**Runtime run** appends `&& mvn clean compile
<quarkus:dev|spring-boot:run|camel:run> -f <path>`.
diff --git a/karavan-vscode/README.md b/karavan-vscode/README.md
index 74f76422..9ac6efb9 100644
--- a/karavan-vscode/README.md
+++ b/karavan-vscode/README.md
@@ -65,6 +65,9 @@ Build-in catalogues:
# Run integration
+The **Camel version** extension setting controls the version passed to Camel
JBang.
+Leave it empty to omit `-Dcamel.jbang.version` and let Camel JBang select its
default version.
+
## Run integration locally
* Run in UI: click `Run` button
diff --git a/karavan-vscode/package.json b/karavan-vscode/package.json
index 074f0375..ca13fac5 100644
--- a/karavan-vscode/package.json
+++ b/karavan-vscode/package.json
@@ -49,7 +49,7 @@
"camel.version": {
"type": "string",
"default": "4.18.1",
- "description": "Camel version",
+ "description": "Camel version. Leave empty to use the default
version selected by Camel JBang.",
"scope": "machine",
"order": 10
},
diff --git a/karavan-vscode/src/jbang.ts b/karavan-vscode/src/jbang.ts
index 7885512b..6148626d 100644
--- a/karavan-vscode/src/jbang.ts
+++ b/karavan-vscode/src/jbang.ts
@@ -45,8 +45,9 @@ export async function camelJbangGenerate(rootPath: string,
openApiFullPath: stri
}
function prepareCommand(command: string): string {
- const version = workspace.getConfiguration().get("camel.version");
- return "jbang \"-Dcamel.jbang.version=" + version + "\" camel@apache/camel
" + command;
+ const version = workspace.getConfiguration().get<string>("camel.version");
+ const versionOption = version && version.trim().length > 0 ? "
\"-Dcamel.jbang.version=" + version + "\"" : "";
+ return "jbang" + versionOption + " camel@apache/camel " + command;
}
export function camelJbangRun() {
@@ -84,4 +85,3 @@ function executeJbangCommand(rootPath: string, command:
string, callback: (code:
}
}
-