Skip to content

Commit 87491bf

Browse files
committed
Fix install script for new branches, where TRAVIS_COMMIT_RANGE is empty
1 parent b30835e commit 87491bf

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

travis/install.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ setup_android_emulator()
7272
# If we are running on Travis CI, and there were no changes to Android
7373
# or ADB code, then we do not need the emulator
7474
if [ -n "$TRAVIS" ]; then
75-
if ! (git log --stat "$TRAVIS_COMMIT_RANGE" | grep -E "android|adb"); then
75+
if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
76+
echo "TRAVIS_COMMIT_RANGE is empty, forcing Android Emulator installation"
77+
elif ! git show "$TRAVIS_COMMIT_RANGE" ; then
78+
echo "TRAVIS_COMMIT_RANGE is invalid, forcing Android Emulator installation"
79+
elif (git log --stat "$TRAVIS_COMMIT_RANGE" | grep -iE "android|adb"); then
80+
echo "Found Android-related commits, forcing Android Emulator installation"
81+
else
7682
# In order to avoid running the doctests that require the Android
7783
# emulator, while still leaving the code intact, we remove the
7884
# RST file that Sphinx searches.

0 commit comments

Comments
 (0)