shellcheck: Pass cargo.sh

This commit is contained in:
Dorota Czaplejewicz
2019-09-27 13:47:49 +00:00
parent 7aff7977fc
commit 0985724b19

View File

@ -6,18 +6,19 @@
set -e set -e
SCRIPT_PATH=`realpath $0` SCRIPT_PATH="$(realpath "$0")"
SOURCE_DIR=`dirname $SCRIPT_PATH` SOURCE_DIR="$(dirname "$SCRIPT_PATH")"
export CARGO_TARGET_DIR=`pwd` CARGO_TARGET_DIR="$(pwd)"
if [ ! -z ${1} ]; then export CARGO_TARGET_DIR
OUT_PATH=`realpath "${1}"` if [ -n "${1}" ]; then
OUT_PATH="$(realpath "$1")"
fi fi
cd $SOURCE_DIR cd "$SOURCE_DIR"
shift shift
cargo $@ cargo "$@"
if [ ! -z ${OUT_PATH} ]; then if [ -n "${OUT_PATH}" ]; then
cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}" cp "${CARGO_TARGET_DIR}"/debug/librs.a "${OUT_PATH}"
fi fi