(teamName: string)
| 129 | */ |
| 130 | // sync IO: called from sync context |
| 131 | export function readTeamFile(teamName: string): TeamFile | null { |
| 132 | try { |
| 133 | const content = readFileSync(getTeamFilePath(teamName), 'utf-8') |
| 134 | return jsonParse(content) as TeamFile |
| 135 | } catch (e) { |
| 136 | if (getErrnoCode(e) === 'ENOENT') return null |
| 137 | logForDebugging( |
| 138 | `[TeammateTool] Failed to read team file for ${teamName}: ${errorMessage(e)}`, |
| 139 | ) |
| 140 | return null |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Reads a team file by name (async — for tool handlers and other async contexts) |
no test coverage detected