(filePath: string, data: AppConfigData)
| 53 | } |
| 54 | |
| 55 | export function saveFile(filePath: string, data: AppConfigData): Promise<void> { |
| 56 | return new Promise((resolve, reject) => { |
| 57 | // Convert config to json string |
| 58 | const json: string = stringifyJsonDataFile(data); |
| 59 | // Save the config file |
| 60 | fs.writeFile(filePath, json, function(error) { |
| 61 | if (error) { return reject(error); } |
| 62 | else { return resolve(); } |
| 63 | }); |
| 64 | }); |
| 65 | } |
| 66 | |
| 67 | function parse(json: any, onError?: (error: string) => void): AppConfigData { |
| 68 | return overwriteConfigData(deepCopy(getDefaultConfigData(process.platform)), json, onError); |
no test coverage detected