diff --git a/scripts/build.sh b/scripts/build.sh index 8dcf387..ed8ca80 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,11 +2,13 @@ set -euo pipefail EXAMPLE="" -BUILD_ARGS="-F dylib" +DYLIB="-F dylib" +BUILD_ARGS="" FILE="workspace/target/debug/app" ENV_VARS="" CMD_ARGS="" ASSETS="./workspace/assets" +RELEASE="" while [[ $# -gt 0 ]]; do case "$1" in @@ -15,6 +17,8 @@ while [[ $# -gt 0 ]]; do -e|--env) ENV_VARS="$2"; shift 2 ;; -a|--args) CMD_ARGS="$2"; shift 2 ;; -A|--assets) ASSETS="$2"; shift 2 ;; + -r|--release) RELEASE="--release"; DYLIB=""; shift ;; + -D|--no-dylib) DYLIB=""; shift ;; *) FILE="$1"; shift ;; esac done @@ -23,4 +27,4 @@ if [ -n "$EXAMPLE" ]; then EXAMPLE="--example $EXAMPLE" fi -cargo build --manifest-path=./workspace/Cargo.toml $BUILD_ARGS $EXAMPLE +cargo build --manifest-path=./workspace/Cargo.toml $BUILD_ARGS $EXAMPLE $RELEASE $DYLIB diff --git a/scripts/play.sh b/scripts/play.sh index ff4f42c..2257860 100755 --- a/scripts/play.sh +++ b/scripts/play.sh @@ -4,11 +4,13 @@ set -e just build $@ EXAMPLE="" -BUILD_ARGS="-F dylib" +DYLIB="-F dylib" +BUILD_ARGS="" FILE="workspace/target/debug/app" ENV_VARS="" CMD_ARGS="" ASSETS="./workspace/assets" +RELEASE="" while [[ $# -gt 0 ]]; do case "$1" in @@ -17,6 +19,8 @@ while [[ $# -gt 0 ]]; do -e|--env) ENV_VARS="$2"; shift 2 ;; -a|--args) CMD_ARGS="$2"; shift 2 ;; -A|--assets) ASSETS="$2"; shift 2 ;; + -r|--release) RELEASE="--release"; DYLIB=""; ;; + -D|--no-dylib) DYLIB=""; ;; *) FILE="$1"; shift ;; esac done @@ -51,7 +55,7 @@ function patch_elf() { } if [ -n "${SSH_CLIENT:-}" ]; then - patch_elf + if [ -n "$DYLIB" ]; then patch_elf(); fi set -x uvx --from cubething_psync psync \ "$TARGET_PATH" -e "${ENV_VARS}" -a "${CMD_ARGS}" -A "${ASSETS}"