Skip to content

Commit

Permalink
Merge pull request #351 from cofacts/fix-blockuser-script
Browse files Browse the repository at this point in the history
fix(scripts): fix top-level await issue
  • Loading branch information
MrOrz authored Nov 9, 2024
2 parents 25f2df4 + 8d9cd48 commit a43812f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scripts/blockUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export default main;

/* istanbul ignore if */
if (require.main === module) {
const argv = await yargs
const argv = yargs
.options({
userId: {
alias: 'u',
Expand All @@ -349,5 +349,7 @@ if (require.main === module) {
})
.help('help').argv;

main(argv).catch(console.error);
// yargs is typed as a promise for some reason, make Typescript happy here
//
Promise.resolve(argv).then(main).catch(console.error);
}

0 comments on commit a43812f

Please sign in to comment.