simplify build.sh logic with case/esac