How to check error when Unity build by command line

I build project by Unity command line:

cd /Applications/Unity/Unity.app/Contents/MacOS
./Unity -batchmode -projectPath [xxx] -executeMethod [xxxx] -logFile [xxx] -quit

When build error, I want to receive prompt message.

How to do this by command line?

Thanks!!!

You probably need to build by yourself.

You can check the exit code of program ($?) or parser the logs and then popup a msg from bash.