Skip to content

Commit

Permalink
fix: make compat checks fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoar committed Apr 26, 2023
1 parent 263ddcd commit ce7917d
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions packages/create-redwood-app/src/create-redwood-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function executeCompatibilityCheck(templateDir, yarnInstall) {
.filter((name) => !result.versions[name].isSatisfied)
.map((name) => {
const { version, wanted } = result.versions[name]
return `${name} ${wanted} required, but you have ${version}`
return `${name} ${wanted} required; found ${version}`
})
return resolve([false, logStatements])
})
Expand All @@ -89,37 +89,22 @@ async function executeCompatibilityCheck(templateDir, yarnInstall) {

if (!engineCheckPassed) {
tui.stopReactive(true)
const engineCheckErrorDocs = terminalLink(
'Tutorial - Prerequisites',
'https://redwoodjs.com/docs/tutorial/chapter1/prerequisites'
)
tui.displayError(
'Compatibility checks failed',
[
` ${engineCheckErrors.join('\n')}`,
'',
` This may make your project incompatible with some deploy targets.`,
` See: ${engineCheckErrorDocs}`,
` Please use tools like nvm or corepack to change to a compatible version.`,
` See: ${terminalLink(
'Tutorial - Prerequisites',
'https://redwoodjs.com/docs/tutorial/chapter1/prerequisites'
)}`,
].join('\n')
)
try {
const response = await tui.prompt({
type: 'select',
name: 'override-engine-error',
message: 'How would you like to proceed?',
choices: ['Override error and continue install', 'Quit install'],
initial: 0,
})
if (response['override-engine-error'] === 'Quit install') {
recordErrorViaTelemetry('User quit after engine check error')
await shutdownTelemetry()
process.exit(1) // TODO: Should we use a different exit code?
}
} catch (error) {
recordErrorViaTelemetry('User cancelled install at engine check error')
await shutdownTelemetry()
process.exit(1)
}

recordErrorViaTelemetry('Compatibility checks failed')
await shutdownTelemetry()
process.exit(1)
}
}

Expand Down

0 comments on commit ce7917d

Please sign in to comment.