Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnolte committed Sep 26, 2024
1 parent b10b6b0 commit 9c15301
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion bin/datasets-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ async function main() {
}
}

main();
main().catch((error) => {
console.error('An unexpected error occurred: ', error);
process.exit(1);
});
6 changes: 4 additions & 2 deletions bin/prompts-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
const { run } = require('../dist/prompts-cli');

async function main() {
// TODO: move this into the new CLI at autoblocksai/cli
if (process.argv[2] === 'generate') {
await run();
} else {
console.error(`Unknown command: ${process.argv.slice(2).join(' ')}`);
}
}

main();
main().catch((error) => {
console.error('An unexpected error occurred: ', error);
process.exit(1);
});
3 changes: 3 additions & 0 deletions src/datasets-cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function makeTypeForProperty(args: { property: PropertySchema }): string {
return `(${args.property.options.map((option) => `'${option}'`).join(' | ')})[]`;
case PropertyTypesEnum.ValidJSON:
return 'Record<string, unknown>';
default:
// @ts-expect-error this is handling the case where a new property type is added
throw new Error(`Unknown property type: ${args.property.type}`);
}
}

Expand Down

0 comments on commit 9c15301

Please sign in to comment.