(cwd, jobId, payload)
| 164 | } |
| 165 | |
| 166 | export function writeJobFile(cwd, jobId, payload) { |
| 167 | ensureStateDir(cwd); |
| 168 | const jobFile = resolveJobFile(cwd, jobId); |
| 169 | fs.writeFileSync(jobFile, `${JSON.stringify(payload, null, 2)}\n`, "utf8"); |
| 170 | return jobFile; |
| 171 | } |
| 172 | |
| 173 | export function readJobFile(jobFile) { |
| 174 | return JSON.parse(fs.readFileSync(jobFile, "utf8")); |
no test coverage detected