From f7b9de5d24567f3972084c6ed2f35dcac8fc9d16 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Thu, 29 Nov 2018 23:24:46 +0000 Subject: [PATCH] Support vendored builds --- scripts/cargo.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/cargo.sh b/scripts/cargo.sh index 8b5f46f..278ab72 100755 --- a/scripts/cargo.sh +++ b/scripts/cargo.sh @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/bash + +set -ex export CARGO_HOME=$1/target/cargo-home export LOCALEDIR="$3" @@ -6,11 +8,16 @@ export APP_ID="$4" export VERSION="$5" export PROFILE="$6" -if test "$PROFILE" = "Devel" -then - echo "DEBUG MODE" - cargo build -p podcasts-gtk && cp $1/target/debug/podcasts-gtk $2 -else +ARGS=() + +if test "$PROFILE" != "Devel"; then echo "RELEASE MODE" - cargo build --release -p podcasts-gtk && cp $1/target/release/podcasts-gtk $2 -fi \ No newline at end of file + ARGS+=('--release') +fi + +if test -d vendor; then + echo "VENDORED" + ARGS+=('--frozen') +fi + +cargo build ${ARGS[@]} -p podcasts-gtk && cp $1/target/release/podcasts-gtk $2 \ No newline at end of file