Преглед изворни кода

add fall back if jq fails to get modified files

Logan Stucki пре 9 година
родитељ
комит
750176d231
No account linked to committer's email
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5
    1
      bin/run-journey-test-from-ci.sh

+ 5
- 1
bin/run-journey-test-from-ci.sh Прегледај датотеку

@@ -3,7 +3,11 @@
3 3
 bin/build-jq.sh
4 4
 
5 5
 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
7 11
 
8 12
 for file in $modded_files
9 13
   do if [[ $file == exercises* ]] || [[ $file == config.json ]]