diff --git a/build.sh b/build.sh index 2da096d..aba54fd 100755 --- a/build.sh +++ b/build.sh @@ -2,8 +2,6 @@ set -eu -printenv - # strip https:// from the urls if ! [[ "$SRC_REPOSITORY" =~ ^https:// ]]; then echo "Only https git urls are supported now. Provided source git url: $SRC_REPOSITORY" @@ -47,10 +45,7 @@ ARGS='--target x86_64-unknown-linux-musl' RUSTFLAGS='' TARGET_DIR="./target/$(rustc --print host-tuple)" -if [[ "$OPT_RELEASE" == "true" ]] || [[ "$OPT_RELEASE" == "True" ]]; then - TARGET_DIR="$TARGET_DIR/release" - ARGS="$ARGS --release" -else +if [[ "$OPT_RELEASE" != "true" ]] && [[ "$OPT_RELEASE" != "True" ]]; then TARGET_DIR="$TARGET_DIR/debug" fi @@ -58,6 +53,7 @@ if [[ "$OPT_BUILD_STD" == "true" ]] || [[ "$OPT_BUILD_STD" == "True" ]]; then RUSTFLAGS="$RUSTFLAGS -Lunwind -L/lib/musl/lib -Lcrt -Lxz -llzma" TOOLCHAIN='+nightly' ARGS="-Z build-std $ARGS" + TARGET_DIR="$TARGET_DIR/release" fi RUSTFLAGS=$RUSTFLAGS cargo $TOOLCHAIN b $ARGS -v