Skip to content
Closed
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
14 changes: 6 additions & 8 deletions src/utils/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Transform } from 'stream'
import { stripVTControlCharacters } from 'util'

import execa from 'execa'
import execa, { type ExecaError } from 'execa'

import { type Spinner } from '../lib/spinner.js'

Expand Down Expand Up @@ -100,13 +100,11 @@
)} exists`,
)
} else {
const errorMessage = result.failed
? // @ts-expect-error FIXME(serhalp): We use `reject: false` which means the resolved value is either the resolved value
// or the rejected value, but the types aren't smart enough to know this.
`${NETLIFYDEVERR} ${result.shortMessage as string}`
: `${NETLIFYDEVWARN} "${command}" exited with code ${result.exitCode.toString()}`

log(`${errorMessage}. Shutting down Netlify Dev server`)
if (result.failed) {
log(`${NETLIFYDEVERR} ${(result as ExecaError).shortMessage}. Shutting down Netlify Dev server`)
} else {
log(`${NETLIFYDEVWARN} "${command}" exited with code ${result.exitCode}. Shutting down Netlify Dev server`)

Check failure on line 106 in src/utils/shell.ts

View workflow job for this annotation

GitHub Actions / Lint

Invalid type "number" of template literal expression
}
}

await cleanupBeforeExit({ exitCode: 1 })
Expand Down
Loading