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 fb2f7d8 Support for windows vscode (#206)
fb2f7d8 is described below
commit fb2f7d8d8bf161e9b01e1a8732c82279f4a6b31b
Author: arnouthoebreckx <[email protected]>
AuthorDate: Fri Mar 4 18:28:14 2022 +0100
Support for windows vscode (#206)
* Support for windows vscode
* saving an already opened yaml file
---
karavan-vscode/src/extension.ts | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/karavan-vscode/src/extension.ts b/karavan-vscode/src/extension.ts
index 14bf78a..1d3f613 100644
--- a/karavan-vscode/src/extension.ts
+++ b/karavan-vscode/src/extension.ts
@@ -58,8 +58,8 @@ export function activate(context: vscode.ExtensionContext) {
"karavan.open",
(...args: any[]) => {
if (args && args.length > 0) {
- const yaml =
fs.readFileSync(path.resolve(args[0].path)).toString('utf8');
- const filename = path.basename(args[0].path);
+ const yaml =
fs.readFileSync(path.resolve(args[0].fsPath)).toString('utf8');
+ const filename = path.basename(args[0].fsPath);
const relativePath = getRalativePath(args[0].path);
const integration = parceYaml(filename, yaml);
if (integration[0]) {
@@ -77,14 +77,14 @@ export function activate(context: vscode.ExtensionContext) {
"karavan.jbang-run",
(...args: any[]) => {
if (args && args.length > 0) {
- if (args[0].path.startsWith('webview-panel/webview')) {
+ if (args[0].fsPath.startsWith('webview-panel/webview')) {
const filename =
Array.from(KARAVAN_PANELS.entries()).filter(({ 1: v }) => v.active).map(([k])
=> k)[0];
if (filename) {
runCamelJbang(filename);
}
} else {
- const yaml =
fs.readFileSync(path.resolve(args[0].path)).toString('utf8');
- const relativePath = getRalativePath(args[0].path);
+ const yaml =
fs.readFileSync(path.resolve(args[0].fsPath)).toString('utf8');
+ const relativePath = getRalativePath(args[0].fsPath);
const filename = path.basename(args[0].path);
const integration = parceYaml(filename, yaml);
if (integration[0]) {
@@ -140,8 +140,8 @@ function openKaravanWebView(context:
vscode.ExtensionContext, webviewContent: st
if (vscode.workspace.workspaceFolders) {
console.log(message);
const uriFolder: vscode.Uri =
vscode.workspace.workspaceFolders[0].uri;
- const uriFile: vscode.Uri =
vscode.Uri.file(path.join(uriFolder.path, message.relativePath));
- fs.writeFile(uriFile.path, message.yaml, err => {
+ const uriFile: vscode.Uri =
vscode.Uri.file(path.join(uriFolder.path, message.filename));
+ fs.writeFile(uriFile.fsPath, message.yaml, err => {
if (err) vscode.window.showErrorMessage("Error: "
+ err?.message);
});
}