()
| 152 | } |
| 153 | |
| 154 | function readState() { |
| 155 | if (!fs.existsSync(STATE_PATH)) { |
| 156 | return defaultState(); |
| 157 | } |
| 158 | try { |
| 159 | return normalizeState(JSON.parse(fs.readFileSync(STATE_PATH, 'utf8'))); |
| 160 | } catch { |
| 161 | return defaultState(); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | function writeState(state) { |
| 166 | if (!fs.existsSync(PLANNING_DIR)) { |
no test coverage detected