(type: "sql" | "orm", suggestion: string)
| 50 | } |
| 51 | |
| 52 | async function inputOutputPath(type: "sql" | "orm", suggestion: string) { |
| 53 | const result = await text({ |
| 54 | message: |
| 55 | type === "sql" |
| 56 | ? "Where to output the SQL migration file?" |
| 57 | : "Where to output the generated schema? (it will override the destination)", |
| 58 | defaultValue: suggestion, |
| 59 | placeholder: suggestion, |
| 60 | }); |
| 61 | |
| 62 | if (isCancel(result)) { |
| 63 | cancel("Migration cancelled."); |
| 64 | process.exit(0); |
| 65 | } |
| 66 | |
| 67 | return result; |
| 68 | } |
| 69 | |
| 70 | return { |
| 71 | async main() { |