Skip to content

Commit

Permalink
Merge pull request #528 from hey-api/fix/bin-config-undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos authored May 5, 2024
2 parents 5574bd4 + d9f7e16 commit 76ca2cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-gorillas-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hey-api/openapi-ts": patch
---

fix: use optional chaining in bin catch block
2 changes: 1 addition & 1 deletion packages/openapi-ts/bin/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async function start() {
await createClient(userConfig);
process.exit(0);
} catch (error) {
if (!userConfig.dryRun) {
if (!userConfig?.dryRun) {
const logName = `openapi-ts-error-${Date.now()}.log`;
const logPath = resolve(process.cwd(), logName);
writeFileSync(logPath, `${error.message}\n${error.stack}`);
Expand Down

0 comments on commit 76ca2cf

Please sign in to comment.