podcasts/scripts/cargo.sh
2019-04-06 21:33:42 +03:00

26 lines
478 B
Bash
Executable File

#!/bin/bash
set -ex
export OUTPUT="$2"
export CARGO_TARGET_DIR="$3"/target
export CARGO_HOME="$CARGO_TARGET_DIR"/cargo-home
export PROFILE="$4"
TARGET=debug
ARGS=()
if test "$PROFILE" != ".Devel"; then
echo "RELEASE MODE"
ARGS+=('--release')
TARGET=release
fi
if test -d vendor; then
echo "VENDORED"
ARGS+=('--frozen')
fi
cargo build ${ARGS[@]} --manifest-path="$1"/Cargo.toml -p podcasts-gtk &&
cp "$CARGO_TARGET_DIR"/${TARGET}/podcasts-gtk "$OUTPUT"