* Extract scheme and simulator ID from xcuserstate file
(filePath: string)
| 79 | * Extract scheme and simulator ID from xcuserstate file |
| 80 | */ |
| 81 | function extractState(filePath: string): { scheme: string | null; simulatorId: string | null } { |
| 82 | try { |
| 83 | const result = parseXcuserstate(filePath); |
| 84 | return { |
| 85 | scheme: result.scheme ?? null, |
| 86 | simulatorId: result.simulatorId ?? null, |
| 87 | }; |
| 88 | } catch (e) { |
| 89 | log('warn', `[xcode-watcher] Failed to parse xcuserstate: ${e}`); |
| 90 | return { scheme: null, simulatorId: null }; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Handle file change event (debounced) |
no test coverage detected