Add a check for build dir existence.