11import process from 'process'
22
3- import execa from 'execa'
3+ import { execaCommand } from 'execa'
44// @ts -expect-error TS(7016) FIXME: Could not find a declaration file for module 'stri... Remove this comment to see the full error message
55import stripAnsiCc from 'strip-ansi-control-characters'
66
@@ -54,7 +54,7 @@ const cleanupBeforeExit = async ({ exitCode }) => {
5454export const runCommand = ( command , options = { } ) => {
5555 // @ts -expect-error TS(2339) FIXME: Property 'cwd' does not exist on type '{}'.
5656 const { cwd, env = { } , spinner = null } = options
57- const commandProcess = execa . command ( command , {
57+ const commandProcess = execaCommand ( command , {
5858 preferLocal : true ,
5959 // we use reject=false to avoid rejecting synchronously when the command doesn't exist
6060 reject : false ,
@@ -84,11 +84,8 @@ export const runCommand = (command, options = {}) => {
8484 } )
8585 }
8686
87- // @ts -expect-error TS(2531) FIXME: Object is possibly 'null'.
8887 commandProcess . stdout . pipe ( stripAnsiCc . stream ( ) ) . on ( 'data' , pipeDataWithSpinner . bind ( null , process . stdout ) )
89- // @ts -expect-error TS(2531) FIXME: Object is possibly 'null'.
9088 commandProcess . stderr . pipe ( stripAnsiCc . stream ( ) ) . on ( 'data' , pipeDataWithSpinner . bind ( null , process . stderr ) )
91- // @ts -expect-error TS(2345) FIXME: Argument of type 'Writable | null' is not assignab... Remove this comment to see the full error message
9289 process . stdin . pipe ( commandProcess . stdin )
9390
9491 // we can't try->await->catch since we don't want to block on the framework server which
@@ -107,8 +104,7 @@ export const runCommand = (command, options = {}) => {
107104 )
108105 } else {
109106 const errorMessage = result . failed
110- ? // @ts -expect-error TS(2339) FIXME: Property 'shortMessage' does not exist on type 'Ex... Remove this comment to see the full error message
111- `${ NETLIFYDEVERR } ${ result . shortMessage } `
107+ ? `${ NETLIFYDEVERR } ${ result . shortMessage } `
112108 : `${ NETLIFYDEVWARN } "${ command } " exited with code ${ result . exitCode } `
113109
114110 log ( `${ errorMessage } . Shutting down Netlify Dev server` )
0 commit comments