ci(aio): fix test

This commit is contained in:
Yuan Gao 2017-06-16 18:21:45 -07:00 committed by Matias Niemelä
parent 86949e0c20
commit 97ace57d39
1 changed files with 14 additions and 6 deletions

View File

@ -41,14 +41,22 @@ timestamp=$(date +%s)
payloadData="$payloadData\"timestamp\": $timestamp, " payloadData="$payloadData\"timestamp\": $timestamp, "
# Add change source: application, dependencies, or 'application+dependencies' # Add change source: application, dependencies, or 'application+dependencies'
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE) yarnChanged=false
yarnChangedFiles=$(grep yarn.lock <<< $allChangedFiles) allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -c "")
allChangedFileNames=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
if [[ ! -z $allChangedFiles ]] && [[ ! -z $yarnChangedFiles ]] && [ "$allChangedFiles" != "$yarnChangedFiles" ]; then if [[ $allChangedFileNames == *"yarn.lock"* ]]; then
change='application+dependencies' yarnChanged=true
elif [[ ! -z $yarnChangedFiles ]]; then fi
echo $yarnChanged
echo $allChangedFileNames
if [[ $allChangedFiles -eq 1 ]] && [[ "$yarnChanged" = true ]]; then
# only yarn.lock changed
change='dependencies' change='dependencies'
elif [[ ! -z $allChangedFiles ]]; then elif [[ $allChangedFiles -gt 1 ]] && [[ "$yarnChanged" = true ]]; then
change='application+dependencies'
elif [[ $allChangedFiles -gt 0 ]]; then
change='application' change='application'
else else
change='' change=''