@@ -18,16 +18,15 @@ const LATEST_SPOKEN_FORMS_JSON_VERSION = 0;
18
18
export class TalonSpokenFormsJsonReader implements TalonSpokenForms {
19
19
private disposer = new Disposer ( ) ;
20
20
private notifier = new Notifier ( ) ;
21
- private cursorlessTalonStateJsonPath ;
22
21
23
22
constructor ( private fileSystem : FileSystem ) {
24
- this . cursorlessTalonStateJsonPath = fileSystem . cursorlessTalonStateJsonPath ;
25
-
26
23
this . init ( ) ;
27
24
}
28
25
29
26
private async init ( ) {
30
- const parentDir = path . dirname ( this . cursorlessTalonStateJsonPath ) ;
27
+ const parentDir = path . dirname (
28
+ this . fileSystem . cursorlessTalonStateJsonPath ,
29
+ ) ;
31
30
await mkdir ( parentDir , { recursive : true } ) ;
32
31
this . disposer . push (
33
32
this . fileSystem . watchDir ( parentDir , ( ) =>
@@ -47,12 +46,12 @@ export class TalonSpokenFormsJsonReader implements TalonSpokenForms {
47
46
let payload : TalonSpokenFormsPayload ;
48
47
try {
49
48
payload = JSON . parse (
50
- await readFile ( this . cursorlessTalonStateJsonPath , "utf-8" ) ,
49
+ await readFile ( this . fileSystem . cursorlessTalonStateJsonPath , "utf-8" ) ,
51
50
) ;
52
51
} catch ( err ) {
53
52
if ( isErrnoException ( err ) && err . code === "ENOENT" ) {
54
53
throw new NeedsInitialTalonUpdateError (
55
- `Custom spoken forms file not found at ${ this . cursorlessTalonStateJsonPath } . Using default spoken forms.` ,
54
+ `Custom spoken forms file not found at ${ this . fileSystem . cursorlessTalonStateJsonPath } . Using default spoken forms.` ,
56
55
) ;
57
56
}
58
57
0 commit comments