File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
cursorless-engine/src/nodeCommon Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { Disposer , FileSystem , Notifier } from "@cursorless/common" ;
2
- import { mkdir , readFile } from "fs/promises" ;
2
+ import { readFile } from "fs/promises" ;
3
3
4
4
import * as path from "path" ;
5
5
import {
@@ -20,17 +20,10 @@ export class TalonSpokenFormsJsonReader implements TalonSpokenForms {
20
20
private notifier = new Notifier ( ) ;
21
21
22
22
constructor ( private fileSystem : FileSystem ) {
23
- this . init ( ) ;
24
- }
25
-
26
- private async init ( ) {
27
- const parentDir = path . dirname (
28
- this . fileSystem . cursorlessTalonStateJsonPath ,
29
- ) ;
30
- await mkdir ( parentDir , { recursive : true } ) ;
31
23
this . disposer . push (
32
- this . fileSystem . watchDir ( parentDir , ( ) =>
33
- this . notifier . notifyListeners ( ) ,
24
+ this . fileSystem . watchDir (
25
+ path . dirname ( this . fileSystem . cursorlessTalonStateJsonPath ) ,
26
+ ( ) => this . notifier . notifyListeners ( ) ,
34
27
) ,
35
28
) ;
36
29
}
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import {
45
45
} from "./ScopeVisualizerCommandApi" ;
46
46
import { StatusBarItem } from "./StatusBarItem" ;
47
47
import { vscodeApi } from "./vscodeApi" ;
48
+ import { mkdir } from "fs/promises" ;
48
49
49
50
/**
50
51
* Extension entrypoint called by VSCode on Cursorless startup.
@@ -149,6 +150,7 @@ async function createVscodeIde(context: vscode.ExtensionContext) {
149
150
const cursorlessDir = isTesting ( )
150
151
? path . join ( os . tmpdir ( ) , crypto . randomBytes ( 16 ) . toString ( "hex" ) )
151
152
: path . join ( os . homedir ( ) , ".cursorless" ) ;
153
+ await mkdir ( cursorlessDir , { recursive : true } ) ;
152
154
153
155
return { vscodeIDE, hats, fileSystem : new VscodeFileSystem ( cursorlessDir ) } ;
154
156
}
You can’t perform that action at this time.
0 commit comments