| 28 | let settingsTarget = undefined; |
| 29 | |
| 30 | function loadSettingsValue(filePath) { |
| 31 | try { |
| 32 | if (existsSync(filePath)) { |
| 33 | const content = readFileSync(filePath, 'utf-8'); |
| 34 | const jsonContent = content.replace(/\/\/[^\n]*/g, ''); |
| 35 | const settings = JSON.parse(jsonContent); |
| 36 | return settings.telemetry?.target; |
| 37 | } |
| 38 | } catch (e) { |
| 39 | console.warn( |
| 40 | `⚠️ Warning: Could not parse settings file at ${filePath}: ${e.message}`, |
| 41 | ); |
| 42 | } |
| 43 | return undefined; |
| 44 | } |
| 45 | |
| 46 | settingsTarget = loadSettingsValue(WORKSPACE_SETTINGS_PATH); |
| 47 | |