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 141141 "type" : " boolean" ,
142142 "default" : true ,
143143 "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."
144149 }
145150 }
146151 }
178183 "@grafana/faro-core" : " ^1.3.5" ,
179184 "@grafana/faro-web-sdk" : " ^1.3.5"
180185 }
181- }
186+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import fsPromise from "node:fs/promises";
55import fs from "node:fs" ;
66import child_process from "node:child_process" ;
77import { promisify } from "node:util" ;
8+ import { configuration } from "../utils/configuration" ;
89const exec = promisify ( child_process . exec ) ;
910
1011export const checkFileOrFolderExists = async ( pathToCheck : string ) => {
@@ -17,6 +18,12 @@ export const checkFileOrFolderExists = async (pathToCheck: string) => {
1718} ;
1819
1920export const getSaveFolder = async ( ) => {
21+ const homedirFromConfiguration = configuration . get ( "homedir" ) ;
22+
23+ if ( homedirFromConfiguration !== "" ) {
24+ return homedirFromConfiguration ;
25+ }
26+
2027 const pathSaveFolder = path . join ( os . homedir ( ) , ".firecoder" ) ;
2128
2229 const folderIsExist = await checkFileOrFolderExists ( pathSaveFolder ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ const ConfigurationProperties = {
2323 "completion.manuallyMode" : {
2424 default : "base-small" ,
2525 } ,
26+ homedir : {
27+ default : "" ,
28+ } ,
2629} as const ;
2730
2831interface ConfigurationPropertiesType
@@ -48,6 +51,9 @@ interface ConfigurationPropertiesType
4851 "completion.manuallyMode" : {
4952 possibleValues : TypeModelsBase ;
5053 } ;
54+ homedir : {
55+ possibleValues : string ;
56+ } ;
5157}
5258
5359class Configuration {
You can’t perform that action at this time.
0 commit comments