Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 3e7d418

Browse files
committed
Added checks to avoid downloading SDK if cache has been applied.
Switched to using 'gnu-tar' on OS X builds.
1 parent 48edb36 commit 3e7d418

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

.travis.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@ before_install:
2424
- mkdir -p "$sdk_path"
2525
- cd "$sdk_path/../.." # Get one level above 'arduino-sdk'
2626
- |
27-
if [[ $TRAVIS_OS_NAME == linux ]]; then
28-
sdk_file="arduino-$ARDUINO_SDK_VERSION-linux64.tar.xz"
29-
else
30-
sdk_file="arduino-$ARDUINO_SDK_VERSION-macosx.zip"
27+
if [[ -z "$(ls -A "$sdk_path")" ]];
28+
then
29+
if [[ $TRAVIS_OS_NAME == linux ]]; then
30+
sdk_file="arduino-$ARDUINO_SDK_VERSION-linux64.tar.xz"
31+
else
32+
sdk_file="arduino-$ARDUINO_SDK_VERSION-macosx.zip"
33+
fi
34+
wget "https://downloads.arduino.cc/$sdk_file" -O "$sdk_file"
35+
if [[ $TRAVIS_OS_NAME == linux ]]; then
36+
tar -xf "$sdk_file" -C arduino-sdk
37+
else
38+
brew install gnu-tar
39+
gtar -xf "$sdk_file" -C arduino-sdk --strip-components=1
40+
fi
3141
fi
32-
- wget "https://downloads.arduino.cc/$sdk_file" -O "$sdk_file"
33-
- |
34-
if [[ $TRAVIS_OS_NAME == linux ]]; then
35-
tar xf "$sdk_file" -C arduino-sdk
36-
else
37-
unzip "$sdk_file" -d arduino-sdk
38-
fi
39-
- ls -l "$sdk_path"
40-
- ls -l "$sdk_path/.."
4142
- export ARDUINO_SDK_PATH="$sdk_path"
4243
install:
4344
- cd "$TRAVIS_BUILD_DIR"

0 commit comments

Comments
 (0)