Browse Source

Use correct arguments for stat on macOS

alexa
Jack Wilsdon 6 years ago
parent
commit
3d21404a67
No known key found for this signature in database GPG Key ID: D657C01A7BC820AE
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      code/build.sh

+ 8
- 1
code/build.sh View File

@ -9,6 +9,13 @@ is_git() {
return 0 return 0
} }
stat_bytes() {
case "$(uname -s)" in
Darwin) stat -f %z "$1";;
*) stat -c %s "$1";;
esac
}
# Script settings # Script settings
destination=../firmware destination=../firmware
@ -104,7 +111,7 @@ build_environments() {
for environment in $environments; do for environment in $environments; do
echo -n "* espurna-$version-$environment.bin --- " echo -n "* espurna-$version-$environment.bin --- "
platformio run --silent --environment $environment || exit 1 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" ]] || \ [[ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]] || \
mv .pioenvs/$environment/firmware.bin $destination/espurna-$version/espurna-$version-$environment.bin mv .pioenvs/$environment/firmware.bin $destination/espurna-$version/espurna-$version-$environment.bin
done done


Loading…
Cancel
Save