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

[camel-karavan] branch main updated: Reload for JBang (#115)

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

marat 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 f92e6b7  Reload for JBang (#115)
f92e6b7 is described below

commit f92e6b7dd025cdee46011ba4253f04874666b154
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Mon Nov 22 07:58:33 2021 -0500

    Reload for JBang (#115)
---
 karavan-vscode/package.json     | 11 ++++++++---
 karavan-vscode/src/extension.ts | 10 +++++++---
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/karavan-vscode/package.json b/karavan-vscode/package.json
index a4d39f0..24e9b38 100644
--- a/karavan-vscode/package.json
+++ b/karavan-vscode/package.json
@@ -53,7 +53,7 @@
       "properties": {
         "CamelJBang.version": {
           "type": "string",
-          "default": "3.13.0",
+          "default": "3.14.0-SNAPSHOT",
           "description": "Camel version"
         },
         "CamelJBang.maxMessages": {
@@ -61,11 +61,16 @@
           "default": 10,
           "description": "Max number of messages to process before stopping"
         },
-        "CamelJBang.debugLevel": {
+        "CamelJBang.loggingLevel": {
           "type": "string",
           "default": "info",
           "enum": ["info", "error", "debug", "trace"],
-          "description": "Default debug level"
+          "description": "Logging level"
+        },
+        "CamelJBang.reload": {
+          "type": "boolean",
+          "default": "true",
+          "description": "Reload routes on change"
         }
       }
     },
diff --git a/karavan-vscode/src/extension.ts b/karavan-vscode/src/extension.ts
index a951501..38c00dd 100644
--- a/karavan-vscode/src/extension.ts
+++ b/karavan-vscode/src/extension.ts
@@ -200,14 +200,18 @@ function parceYaml(filename: string, yaml: string): [boolean, string?] {
 function runCamelJbang(filename: string) {
     const version = vscode.workspace.getConfiguration().get("CamelJBang.version");
     const maxMessages = vscode.workspace.getConfiguration().get("CamelJBang.maxMessages");
-    const debugLevel = vscode.workspace.getConfiguration().get("CamelJBang.debugLevel");
+    const loggingLevel = vscode.workspace.getConfiguration().get("CamelJBang.loggingLevel");
+    const reload = vscode.workspace.getConfiguration().get("CamelJBang.reload");
+    const command = "jbang -Dcamel.jbang.version=" + version + " CamelJBang@apache/camel run " + filename 
+            + " --max-messages=" + maxMessages 
+            + " --logging-level=" + loggingLevel
+            + (reload ? " --reload" : "");
     const existTerminal = TERMINALS.get(filename);
     if (existTerminal) existTerminal.dispose();
     const terminal = vscode.window.createTerminal('CamelJBang: ' + filename);
     TERMINALS.set(filename, terminal);
     terminal.show();
-    terminal.sendText("jbang -Dcamel.jbang.version=" + version + " CamelJBang@apache/camel run " + filename 
-        + " --max-messages=" + maxMessages + " --debug-level=" + debugLevel);
+    terminal.sendText(command);
 }
 
 export function deactivate() {