diff --git a/build.sh b/build.sh index aba54fd..2da096d 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,8 @@ 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" @@ -45,7 +47,10 @@ ARGS='--target x86_64-unknown-linux-musl' RUSTFLAGS='' TARGET_DIR="./target/$(rustc --print host-tuple)" -if [[ "$OPT_RELEASE" != "true" ]] && [[ "$OPT_RELEASE" != "True" ]]; then +if [[ "$OPT_RELEASE" == "true" ]] || [[ "$OPT_RELEASE" == "True" ]]; then + TARGET_DIR="$TARGET_DIR/release" + ARGS="$ARGS --release" +else TARGET_DIR="$TARGET_DIR/debug" fi @@ -53,7 +58,6 @@ 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