From 3d21404a67b4e1670baddf8788ca10aea42e6ad0 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 18 Nov 2018 20:03:35 +0000 Subject: [PATCH] Use correct arguments for stat on macOS --- code/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/build.sh b/code/build.sh index 14c95fe0..deb5f930 100755 --- a/code/build.sh +++ b/code/build.sh @@ -9,6 +9,13 @@ is_git() { return 0 } +stat_bytes() { + case "$(uname -s)" in + Darwin) stat -f %z "$1";; + *) stat -c %s "$1";; + esac +} + # Script settings destination=../firmware @@ -104,7 +111,7 @@ build_environments() { for environment in $environments; do echo -n "* espurna-$version-$environment.bin --- " platformio run --silent --environment $environment || exit 1 - stat -c %s .pioenvs/$environment/firmware.bin + stat_bytes .pioenvs/$environment/firmware.bin [[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \ mv .pioenvs/$environment/firmware.bin $destination/espurna-$version/espurna-$version-$environment.bin done