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