cargo: Use release mode for release builds

This commit is contained in:
Dorota Czaplejewicz
2019-11-19 13:09:01 +00:00
parent 9b271a6919
commit 0adde1004f
5 changed files with 47 additions and 20 deletions

View File

@ -11,21 +11,7 @@ SOURCE_DIR="$(dirname "$SCRIPT_PATH")"
CARGO_TARGET_DIR="$(pwd)"
export CARGO_TARGET_DIR
if [ "${1}" = "--rename" ]; then
shift
FILENAME="${1}"
shift
OUT_PATH="$(realpath "${1}")"
elif [ "${1}" = "--output" ]; then
shift
OUT_PATH="$(realpath "${1}")"
FILENAME="$(basename "${OUT_PATH}")"
fi
shift
cd "$SOURCE_DIR"
cargo "$@"
if [ -n "${OUT_PATH}" ]; then
cp -a "${CARGO_TARGET_DIR}"/debug/"${FILENAME}" "${OUT_PATH}"
fi