diff --git a/scripts/circleci/set_up_github_keys.sh b/scripts/circleci/set_up_github_keys.sh index 302c40eef0..4179f1e35b 100755 --- a/scripts/circleci/set_up_github_keys.sh +++ b/scripts/circleci/set_up_github_keys.sh @@ -2,9 +2,9 @@ set -e -if [ -n $GITHUB_TOKEN ]; then +if [ -n "$GITHUB_TOKEN" ]; then - GH_PAGES_DIR=`pwd`/../react-gh-pages + GH_PAGES_DIR=$(pwd)/../react-gh-pages echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc git config --global user.name "Circle CI" git config --global user.email "circle@reactjs.org" diff --git a/scripts/circleci/test_coverage.sh b/scripts/circleci/test_coverage.sh index 91e12f5256..af5fa9b7b1 100755 --- a/scripts/circleci/test_coverage.sh +++ b/scripts/circleci/test_coverage.sh @@ -3,8 +3,8 @@ set -e yarn test --coverage --maxWorkers=2 -if [ -z $CI_PULL_REQUEST ]; then - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls +if [ -z "$CI_PULL_REQUEST" ]; then + ./node_modules/.bin/coveralls < ./coverage/lcov.info fi # TODO: should we also track prod code coverage somehow? diff --git a/scripts/circleci/track_stats.sh b/scripts/circleci/track_stats.sh index a2f961cbe9..3f4238b9ae 100755 --- a/scripts/circleci/track_stats.sh +++ b/scripts/circleci/track_stats.sh @@ -2,7 +2,7 @@ set -e -ALL_FILES=`find packages -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` -COUNT_ALL_FILES=`echo "$ALL_FILES" | wc -l` -COUNT_WITH_FLOW=`grep '@flow' $ALL_FILES | perl -pe 's/:.+//' | wc -l` +ALL_FILES=$(find packages -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__) +COUNT_ALL_FILES=$(echo "$ALL_FILES" | wc -l) +COUNT_WITH_FLOW=$(grep '@flow' $ALL_FILES | perl -pe 's/:.+//' | wc -l) node scripts/facts-tracker/index.js "flow-files" "$COUNT_WITH_FLOW/$COUNT_ALL_FILES" diff --git a/scripts/circleci/upload_build.sh b/scripts/circleci/upload_build.sh index 26ae3e9bed..978acc296d 100755 --- a/scripts/circleci/upload_build.sh +++ b/scripts/circleci/upload_build.sh @@ -2,7 +2,7 @@ set -e -if [ -z $CI_PULL_REQUEST ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then +if [ -z "$CI_PULL_REQUEST" ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then curl \ -F "react.development=@build/dist/react.development.js" \ -F "react.production.min=@build/dist/react.production.min.js" \ @@ -12,9 +12,9 @@ if [ -z $CI_PULL_REQUEST ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then -F "react-dom-server.browser.production.min=@build/dist/react-dom-server.browser.production.min.js" \ -F "results.json=@build/../scripts/rollup/results.json" \ -F "commit=$CIRCLE_SHA1" \ - -F "date=`git log --format='%ct' -1`" \ + -F "date=$(git log --format='%ct' -1)" \ -F "pull_request=false" \ -F "token=$BUILD_SERVER_TOKEN" \ -F "branch=$CIRCLE_BRANCH" \ - $BUILD_SERVER_ENDPOINT + "$BUILD_SERVER_ENDPOINT" fi