diff --git a/app/build_distros.sh b/app/build_distros.sh index c742bc1..19cfeb0 100644 --- a/app/build_distros.sh +++ b/app/build_distros.sh @@ -1,4 +1,3 @@ - #!/bin/bash PLATFORMS="darwin/amd64" @@ -16,9 +15,11 @@ type setopt >/dev/null 2>&1 SCRIPT_NAME=`basename "$0"` FAILURES="" PREFIX="processor" -BIN_PATH="bin" +BIN_PATH="./bin" DISTROS="assets/build" +rm -rf "${BIN_PATH:?}/"* + for PLATFORM in $PLATFORMS; do GOOS=${PLATFORM%/*} GOARCH=${PLATFORM#*/} @@ -29,7 +30,7 @@ for PLATFORM in $PLATFORMS; do if [[ "${GOOS}" == "windows" ]]; then BIN_FILENAME="${BIN_FILENAME}.exe"; fi CMD="GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${BIN_PATH}/${OUTPUT_DIR}/${BIN_FILENAME} main.go && cp -n ${DISTROS}/config.yml ${BIN_PATH}/${OUTPUT_DIR}/ - && tar -cf ${BIN_PATH}/${OUTPUT_DIR}.tar ${BIN_PATH}/${OUTPUT_DIR}/${BIN_FILENAME}" + && tar -czf ${BIN_PATH}/${OUTPUT_DIR}.tar.gz ${BIN_PATH}/${OUTPUT_DIR}" echo "${CMD}" eval $CMD || FAILURES="${FAILURES} ${PLATFORM}" done