From a2ba1043e7dd89585b6f72b9dd7d3f12e5a0eaa7 Mon Sep 17 00:00:00 2001 From: Lazar Obradovic Date: Thu, 30 Aug 2018 21:25:05 +0200 Subject: [PATCH 1/2] make stat mac aware don't hide errors. --- code/build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/build.sh b/code/build.sh index 0541e280..5d43bea4 100755 --- a/code/build.sh +++ b/code/build.sh @@ -103,8 +103,12 @@ build_environments() { for environment in $environments; do echo -n "* espurna-$version-$environment.bin --- " - platformio run --silent --environment $environment 2>/dev/null || exit 1 - stat -c %s .pioenvs/$environment/firmware.bin + platformio run --silent --environment $environment || exit 1 + if [[ $(uname -s) -eq "Darwin" ]]; then + stat -f %z .pioenvs/$environment/firmware.bin + else + stat -c %s .pioenvs/$environment/firmware.bin + fi [[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \ mv .pioenvs/$environment/firmware.bin $destination/espurna-$version/espurna-$version-$environment.bin done From 0a8f98781eb08f4c78a55b726b1060ddaa26b709 Mon Sep 17 00:00:00 2001 From: Lazar Obradovic Date: Thu, 30 Aug 2018 22:00:48 +0200 Subject: [PATCH 2/2] bash compares strings with ==, not with -eq ^_^ --- code/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/build.sh b/code/build.sh index 5d43bea4..704f1346 100755 --- a/code/build.sh +++ b/code/build.sh @@ -104,7 +104,7 @@ build_environments() { for environment in $environments; do echo -n "* espurna-$version-$environment.bin --- " platformio run --silent --environment $environment || exit 1 - if [[ $(uname -s) -eq "Darwin" ]]; then + if [[ $(uname -s) == "Darwin" ]]; then stat -f %z .pioenvs/$environment/firmware.bin else stat -c %s .pioenvs/$environment/firmware.bin