File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 141
141
"type" : " boolean" ,
142
142
"default" : true ,
143
143
"markdownDescription" : " Enable experimental possibility to use opened tabs as context for manual completion mode."
144
+ },
145
+ "firecoder.homedir" : {
146
+ "type" : " string" ,
147
+ "default" : " " ,
148
+ "description" : " The directory to use for storing user data associated with this extension. Set to an empty string, `os.homedir()` will be used."
144
149
}
145
150
}
146
151
}
178
183
"@grafana/faro-core" : " ^1.3.5" ,
179
184
"@grafana/faro-web-sdk" : " ^1.3.5"
180
185
}
181
- }
186
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import fsPromise from "node:fs/promises";
5
5
import fs from "node:fs" ;
6
6
import child_process from "node:child_process" ;
7
7
import { promisify } from "node:util" ;
8
+ import { configuration } from "../utils/configuration" ;
8
9
const exec = promisify ( child_process . exec ) ;
9
10
10
11
export const checkFileOrFolderExists = async ( pathToCheck : string ) => {
@@ -17,6 +18,12 @@ export const checkFileOrFolderExists = async (pathToCheck: string) => {
17
18
} ;
18
19
19
20
export const getSaveFolder = async ( ) => {
21
+ const homedirFromConfiguration = configuration . get ( "homedir" ) ;
22
+
23
+ if ( homedirFromConfiguration !== "" ) {
24
+ return homedirFromConfiguration ;
25
+ }
26
+
20
27
const pathSaveFolder = path . join ( os . homedir ( ) , ".firecoder" ) ;
21
28
22
29
const folderIsExist = await checkFileOrFolderExists ( pathSaveFolder ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ const ConfigurationProperties = {
23
23
"completion.manuallyMode" : {
24
24
default : "base-small" ,
25
25
} ,
26
+ homedir : {
27
+ default : "" ,
28
+ } ,
26
29
} as const ;
27
30
28
31
interface ConfigurationPropertiesType
@@ -48,6 +51,9 @@ interface ConfigurationPropertiesType
48
51
"completion.manuallyMode" : {
49
52
possibleValues : TypeModelsBase ;
50
53
} ;
54
+ homedir : {
55
+ possibleValues : string ;
56
+ } ;
51
57
}
52
58
53
59
class Configuration {
You can’t perform that action at this time.
0 commit comments