Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/easy-dolls-show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"graphile-migrate": patch
---

parseSync can't work with subcommands; revert to argv/isPromise
15 changes: 12 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env node
import { isPromise } from "node:util/types";

import yargs from "yargs";

import { commitCommand } from "./commands/commit";
Expand Down Expand Up @@ -37,7 +39,7 @@ function wrapHandler<T1, T2>(
};
}

yargs
const argv = yargs
.parserConfiguration({
"boolean-negation": true,
"camel-case-expansion": false,
Expand Down Expand Up @@ -101,5 +103,12 @@ You are running graphile-migrate v${version}.
║ 🙏 THANK YOU SPONSORS! 🙏 ║
╚═══════════════════════════════════╝
`,
)
.parseSync();
).argv;

if (isPromise(argv)) {
argv.then(null, (e) => {
// eslint-disable-next-line no-console
console.error(e);
process.exit(1);
});
}