Skip to content

Commit 750176d

Browse files
committed
add fall back if jq fails to get modified files
1 parent 1161592 commit 750176d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bin/run-journey-test-from-ci.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
bin/build-jq.sh
44

55
pr_files_json=`curl -s https://api.github.com/repos/exercism/java/pulls/${TRAVIS_PULL_REQUEST}/files`
6-
modded_files=`echo $pr_files_json | bin/jq -r '.[].filename'`
6+
7+
# if jq fails to get the required data, then that means TRAVIS_PULL_REQUEST was not set (not run in travis-ci),
8+
# or was false (not a pull request). In that case, we should fall back with testing every exercise
9+
10+
modded_files=`echo $pr_files_json | bin/jq -r '.[].filename'` || bin/journey-test.sh
711

812
for file in $modded_files
913
do if [[ $file == exercises* ]] || [[ $file == config.json ]]

0 commit comments

Comments
 (0)