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 11import { Disposer , FileSystem , Notifier } from "@cursorless/common" ;
2- import { mkdir , readFile } from "fs/promises" ;
2+ import { readFile } from "fs/promises" ;
33
44import * as path from "path" ;
55import {
@@ -20,17 +20,10 @@ export class TalonSpokenFormsJsonReader implements TalonSpokenForms {
2020 private notifier = new Notifier ( ) ;
2121
2222 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 } ) ;
3123 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 ( ) ,
3427 ) ,
3528 ) ;
3629 }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import {
4545} from "./ScopeVisualizerCommandApi" ;
4646import { StatusBarItem } from "./StatusBarItem" ;
4747import { vscodeApi } from "./vscodeApi" ;
48+ import { mkdir } from "fs/promises" ;
4849
4950/**
5051 * Extension entrypoint called by VSCode on Cursorless startup.
@@ -149,6 +150,7 @@ async function createVscodeIde(context: vscode.ExtensionContext) {
149150 const cursorlessDir = isTesting ( )
150151 ? path . join ( os . tmpdir ( ) , crypto . randomBytes ( 16 ) . toString ( "hex" ) )
151152 : path . join ( os . homedir ( ) , ".cursorless" ) ;
153+ await mkdir ( cursorlessDir , { recursive : true } ) ;
152154
153155 return { vscodeIDE, hats, fileSystem : new VscodeFileSystem ( cursorlessDir ) } ;
154156}
You can’t perform that action at this time.
0 commit comments