From 2274be20d51759a2027e5f03df5cf3f5b5e31290 Mon Sep 17 00:00:00 2001 From: Alena Khineika Date: Wed, 22 Sep 2021 13:33:02 +0200 Subject: [PATCH 1/2] feat: handle editor specifies as name with multiple parts MONGOSH-996 --- packages/editor/src/editor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/editor.ts b/packages/editor/src/editor.ts index 5aa4c0b78f..41e2add69a 100644 --- a/packages/editor/src/editor.ts +++ b/packages/editor/src/editor.ts @@ -170,7 +170,11 @@ export class Editor { code }); - const proc = spawn(editor, [tmpDoc], { stdio: 'inherit' }); + const proc = spawn(editor, [path.basename(tmpDoc)], { + stdio: 'inherit', + cwd: path.dirname(tmpDoc), + shell: true + }); // Pause the parent readable stream to stop emitting data events // and get a child the total control over the input. this._input.pause(); From edbe214b9ce5b2e63713843e611a4f3df3570d46 Mon Sep 17 00:00:00 2001 From: Alena Khineika Date: Wed, 22 Sep 2021 13:48:40 +0200 Subject: [PATCH 2/2] docs: update a comment --- packages/editor/src/editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/editor.ts b/packages/editor/src/editor.ts index 41e2add69a..dcf9449f2f 100644 --- a/packages/editor/src/editor.ts +++ b/packages/editor/src/editor.ts @@ -66,7 +66,7 @@ export class Editor { // In case of using VSCode as an external editor, // detect whether the MongoDB extension is installed and open a .mongodb file. - // If not open a .js file instead. + // If not open a .js file. async _getExtension(cmd: string): Promise { if (!this._isVscodeApp(cmd)) { return 'js';