#!/bin/sh
[[ ! -e static-analysis ]] && mkdir static-analysis
cd static-analysis
scan-build cmake ..
make clean
scan-build make

#!/bin/sh
[[ ! -e static-analysis ]] && mkdir static-analysis
cd static-analysis
scan-build --status-bugs cmake ..
make clean
scan-build --status-bugs make

Set output of static analysis script to nonzero if bugs are found
Fix: Set output of static analysis script to nonzero if bugs are found
