(rootDir: string)
| 32 | } |
| 33 | |
| 34 | export async function exitPre(rootDir: string) { |
| 35 | let preStatePath = path.resolve(rootDir, ".changeset", "pre.json"); |
| 36 | // TODO: verify that the pre state isn't broken |
| 37 | let preState = await readPreState(rootDir); |
| 38 | |
| 39 | if (preState === undefined) { |
| 40 | throw new PreExitButNotInPreModeError(); |
| 41 | } |
| 42 | |
| 43 | await fs.outputFile( |
| 44 | preStatePath, |
| 45 | JSON.stringify({ ...preState, mode: "exit" }, null, 2) + "\n" |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | export async function enterPre(rootDir: string, tag: string) { |
| 50 | let packages = await getPackages(rootDir); |
no test coverage detected