Просмотр исходного кода

add fall back if jq fails to get modified files

Logan Stucki 9 лет назад
Родитель
Сommit
750176d231
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 5 добавлений и 1 удалений
  1. 5
    1
      bin/run-journey-test-from-ci.sh

+ 5
- 1
bin/run-journey-test-from-ci.sh Просмотреть файл

3
 bin/build-jq.sh
3
 bin/build-jq.sh
4
 
4
 
5
 pr_files_json=`curl -s https://api.github.com/repos/exercism/java/pulls/${TRAVIS_PULL_REQUEST}/files`
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
 for file in $modded_files
12
 for file in $modded_files
9
   do if [[ $file == exercises* ]] || [[ $file == config.json ]]
13
   do if [[ $file == exercises* ]] || [[ $file == config.json ]]