| 31 | } |
| 32 | |
| 33 | function getUUID(): string { |
| 34 | if (!uuid) { |
| 35 | const settingspath = path.join(os.homedir(), '.cortex-debug'); |
| 36 | if (fs.existsSync(settingspath)) { |
| 37 | const data = fs.readFileSync(settingspath, 'utf8'); |
| 38 | const settings: UserSettings = JSON.parse(data); |
| 39 | uuid = settings.uuid; |
| 40 | } |
| 41 | else { |
| 42 | uuid = uuidv4(); |
| 43 | const settings: UserSettings = { uuid: uuid }; |
| 44 | fs.writeFileSync(settingspath, JSON.stringify(settings), 'utf8'); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | return uuid; |
| 49 | } |
| 50 | |
| 51 | function telemetryEnabled(): boolean { |
| 52 | const telemetry = vscode.workspace.getConfiguration('telemetry'); |