child_process.exec在命令返回0时发生错误
exec(
`git diff --cached -- ${filenames.join(
' ',
)} | grep -e "^+[^+]" | grep "} from 'react';" -c`,
(error, errorCnt) => {
if (error) {
console.log('React dot error', error);
throw error;
}
}
);
git diff --cached -- ${filenames.join(' ')} | grep -e "^+[^+]" | grep "} from 'react';" -c
我不知道为什么该命令返回0 child_process.exec时会出错。