(projectFolder: string, settings: any)
| 18 | } |
| 19 | |
| 20 | function writeSettingIntoProject(projectFolder: string, settings: any): void { |
| 21 | const vsCodeFolder = path.join(projectFolder, ".vscode"); |
| 22 | const settingsFile = path.join(vsCodeFolder, "settings.json"); |
| 23 | |
| 24 | if (!fs.existsSync(vsCodeFolder)) |
| 25 | fs.mkdirSync(vsCodeFolder); |
| 26 | |
| 27 | // The file should never exist, because the user has to select a new folder |
| 28 | // to create projects. If it exists, something is wrong. We can't just load |
| 29 | // the file, because VS Code settings file are not standard JSON (they can |
| 30 | // have comments) so we don't want to try and deal with parsing them. |
| 31 | if (fs.existsSync(settingsFile)) |
| 32 | return; |
| 33 | |
| 34 | fs.writeFileSync(settingsFile, JSON.stringify(settings, undefined, 4)); |
| 35 | |
| 36 | } |
no outgoing calls
no test coverage detected