Skip to content

Commit

Permalink
fix: improve remix init error handling
Browse files Browse the repository at this point in the history
Add error catching and logging to the initialization process to provide better feedback if something goes wrong during project setup

Closes #943
  • Loading branch information
kentcdodds committed Feb 22, 2025
1 parent 9542505 commit 4f8ab85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion remix.init/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = async (...args) => {
const { default: main } = await import('./index.mjs')
await main(...args)
await main(...args).catch((err) => {
console.error('Oh no! Something went wrong initializing your epic app:')
console.error(err)
process.exit(1)
})
}
1 change: 0 additions & 1 deletion remix.init/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export default async function main({ rootDirectory }) {
fs.rm(path.join(rootDirectory, 'docs'), { recursive: true }),
fs.rm(path.join(rootDirectory, 'tests/e2e/notes.test.ts')),
fs.rm(path.join(rootDirectory, 'tests/e2e/search.test.ts')),
fs.rm(path.join(rootDirectory, '.github/workflows/version.yml')),
]

await Promise.all(fileOperationPromises)
Expand Down

0 comments on commit 4f8ab85

Please sign in to comment.