MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / saveFile

Function saveFile

src/back/ExtConfigFile.ts:33–43  ·  view source on GitHub ↗
(filePath: string, data: AppExtConfigData)

Source from the content-addressed store, hash-verified

31 }
32
33 export function saveFile(filePath: string, data: AppExtConfigData): Promise<void> {
34 return new Promise((resolve, reject) => {
35 // Convert config to json string
36 const json: string = stringifyJsonDataFile(data);
37 // Save the config file
38 fs.writeFile(filePath, json, function(error) {
39 if (error) { return reject(error); }
40 else { return resolve(); }
41 });
42 });
43 }
44
45 function parse(json: any): AppExtConfigData {
46 return overwriteExtConfigData({}, json);

Callers 1

readOrCreateFileFunction · 0.70

Calls 1

stringifyJsonDataFileFunction · 0.90

Tested by

no test coverage detected