From 34c195b4c0abb5d3c893874852508d07eb4994e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 27 Aug 2018 10:49:38 +0200 Subject: [PATCH] Option to specify destination folder for images generated by build.sh script --- code/build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/build.sh b/code/build.sh index 5ebf5ace..14c95fe0 100755 --- a/code/build.sh +++ b/code/build.sh @@ -10,6 +10,8 @@ is_git() { } # Script settings + +destination=../firmware version=$(grep APP_VERSION espurna/config/version.h | awk '{print $3}' | sed 's/"//g') if is_git; then @@ -104,13 +106,13 @@ build_environments() { platformio run --silent --environment $environment || exit 1 stat -c %s .pioenvs/$environment/firmware.bin [[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \ - mv .pioenvs/$environment/firmware.bin ../firmware/espurna-$version/espurna-$version-$environment.bin + mv .pioenvs/$environment/firmware.bin $destination/espurna-$version/espurna-$version-$environment.bin done echo "--------------------------------------------------------------" } # Parameters -while getopts "lp" opt; do +while getopts "lpd:" opt; do case $opt in l) print_available @@ -119,6 +121,9 @@ while getopts "lp" opt; do p) par_build=true ;; + d) + destination=$OPTARG + ;; esac done