improve error reporting for failed commands in build script