From d7d1c53c524deb252aa2032a056a2f3a71bc3729 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 12 Oct 2024 15:26:01 +0300 Subject: [PATCH] build: incremental release on desktop development --- scripts/desktop.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/desktop.sh b/scripts/desktop.sh index e151ab2..00e7952 100755 --- a/scripts/desktop.sh +++ b/scripts/desktop.sh @@ -1,25 +1,27 @@ #!/bin/bash case $1 in - debug|release) + debug|build) ;; *) - echo "Usage: build_run.sh [type] where is type is 'debug' or 'release'" >&2 + echo "Usage: build_run.sh [type] where is type is 'debug' or 'build'" >&2 exit 1 esac # Setup build directory -BASEDIR=$(cd $(dirname $0) && pwd) -cd ${BASEDIR} +BASEDIR=$(cd "$(dirname $0)" && pwd) +cd "${BASEDIR}" || return cd .. # Build application type=$1 -[[ ${type} == "release" ]] && release_param+=(--release) -cargo build ${release_param[@]} +[[ ${type} == "build" ]] && release_param+=(--release) +cargo --config profile.release.incremental=true build "${release_param[@]}" # Start application if [ $? -eq 0 ] then - ./target/${type}/grim -fi \ No newline at end of file + path=${type} + [[ ${type} == "build" ]] && path="release" + ./target/"${path}"/grim +fi