@samitouri / QOS-React / commits / 3ed6483e14

Clean shell scripts (#12365)

Léo Andrès committed Mar 21, 2018 at 16:03 UTC 3ed6483e1413325d01dc4e66fe904922def1658d
4 files changed +10 -10
scripts/circleci/set_up_github_keys.sh
+2 -2
@@ -2,9 +2,9 @@
2
3 set -e
4
5 -if [ -n $GITHUB_TOKEN ]; then
5 +if [ -n "$GITHUB_TOKEN" ]; then
6
7 - GH_PAGES_DIR=`pwd`/../react-gh-pages
7 + GH_PAGES_DIR=$(pwd)/../react-gh-pages
8 echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
9 git config --global user.name "Circle CI"
10 git config --global user.email "circle@reactjs.org"
scripts/circleci/test_coverage.sh
+2 -2
@@ -3,8 +3,8 @@
3 set -e
4
5 yarn test --coverage --maxWorkers=2
6 -if [ -z $CI_PULL_REQUEST ]; then
7 - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
6 +if [ -z "$CI_PULL_REQUEST" ]; then
7 + ./node_modules/.bin/coveralls < ./coverage/lcov.info
8 fi
9
10 # TODO: should we also track prod code coverage somehow?
scripts/circleci/track_stats.sh
+3 -3
@@ -2,7 +2,7 @@
2
3 set -e
4
5 -ALL_FILES=`find packages -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__`
6 -COUNT_ALL_FILES=`echo "$ALL_FILES" | wc -l`
7 -COUNT_WITH_FLOW=`grep '@flow' $ALL_FILES | perl -pe 's/:.+//' | wc -l`
5 +ALL_FILES=$(find packages -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__)
6 +COUNT_ALL_FILES=$(echo "$ALL_FILES" | wc -l)
7 +COUNT_WITH_FLOW=$(grep '@flow' $ALL_FILES | perl -pe 's/:.+//' | wc -l)
8 node scripts/facts-tracker/index.js "flow-files" "$COUNT_WITH_FLOW/$COUNT_ALL_FILES"
scripts/circleci/upload_build.sh
+3 -3
@@ -2,7 +2,7 @@
2
3 set -e
4
5 -if [ -z $CI_PULL_REQUEST ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then
5 +if [ -z "$CI_PULL_REQUEST" ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then
6 curl \
7 -F "react.development=@build/dist/react.development.js" \
8 -F "react.production.min=@build/dist/react.production.min.js" \
@@ -12,9 +12,9 @@ if [ -z $CI_PULL_REQUEST ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then
12 -F "react-dom-server.browser.production.min=@build/dist/react-dom-server.browser.production.min.js" \
13 -F "results.json=@build/../scripts/rollup/results.json" \
14 -F "commit=$CIRCLE_SHA1" \
15 - -F "date=`git log --format='%ct' -1`" \
15 + -F "date=$(git log --format='%ct' -1)" \
16 -F "pull_request=false" \
17 -F "token=$BUILD_SERVER_TOKEN" \
18 -F "branch=$CIRCLE_BRANCH" \
19 - $BUILD_SERVER_ENDPOINT
19 + "$BUILD_SERVER_ENDPOINT"
20 fi