File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ sudo apt-get install --force-yes --no-install-recommends --no-install-suggests \
61
61
xvfb \
62
62
python-pip \
63
63
flip \
64
+ jq \
64
65
postgresql-9.1-postgis-2.1/precise # from ubuntugis-unstable, not pgdg
65
66
66
67
sudo -H pip install autopep8 # TODO when switching to trusty or above: replace python-pip with python-autopep8
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
9
9
exit 0
10
10
fi
11
11
12
- TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE/ .../ ..}
13
-
14
12
if ! type -p astyle.sh > /dev/null; then
15
13
echo astyle.sh not found
16
14
exit 1
@@ -21,12 +19,17 @@ set -e
21
19
ASTYLEDIFF=/tmp/astyle.diff
22
20
> $ASTYLEDIFF
23
21
24
- echo " Checking indentation in $TRAVIS_COMMIT_RANGE "
25
- echo " Checking indentation in $TRAVIS_COMMIT_RANGE " >> /tmp/ctest-important.log
26
- git log $TRAVIS_COMMIT_RANGE >> /tmp/ctest-important.log 2>&1
27
- git diff --name-only $TRAVIS_COMMIT_RANGE >> /tmp/ctest-important.log 2>&1
22
+ case " ${TRAVIS_COMMIT_RANGE} " in
23
+ * ...* )
24
+ curl https://api.github.com/repos/$TRAVIS_REPO_SLUG /compare/$TRAVIS_COMMIT_RANGE | jq -r .files[].filename > /tmp/changed-files
25
+ ;;
26
+
27
+ * )
28
+ git diff --name-only $TRAVIS_COMMIT_RANGE > /tmp/changed-files
29
+ ;;
30
+ esac
28
31
29
- git diff --name-only $TRAVIS_COMMIT_RANGE | while read f
32
+ while read f
30
33
do
31
34
if ! [ -f " $f " ]; then
32
35
echo " $f was removed." >> /tmp/ctest-important.log
56
59
else
57
60
echo " File $f needs indentation"
58
61
fi
59
- done
62
+ done < /tmp/changed-files
60
63
61
64
if [ -s " $ASTYLEDIFF " ]; then
62
65
echo
You can’t perform that action at this time.
0 commit comments