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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Fix creation sentry example when no routes folder ([#680](https://github.com/getsentry/sentry-wizard/pull/680))

## 3.32.0

- feat: Add `--saas` CLI arg to skip self-hosted or SaaS selection step (#678)
Expand Down
6 changes: 6 additions & 0 deletions src/remix/sdk-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export async function createExamplePage(options: {
url: string;
isTS: boolean;
}) {
const routesPath = 'app/routes';

if (!fs.existsSync(routesPath)) {
fs.mkdirSync(routesPath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may fail, when there is no /app folder. We probably want to do fs.mkdirSync(routesPath, { recursive: true }).

Copy link
Member Author

@priscilawebdev priscilawebdev Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great feedback @lforst . I updated the code in the PR #681

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it fails to create the file if the app folder doesn't exist. It's part of the default Remix setup, so it's unlikely to be missing, but adding recursive: true was a good idea

}

const exampleRoutePath = `app/routes/sentry-example-page.${
options.isTS ? 'ts' : 'js'
}x`;
Expand Down
Loading