|
4 | 4 | # This source code is licensed under the MIT license found in the |
5 | 5 | # LICENSE file in the root directory of this source tree. |
6 | 6 |
|
| 7 | +node_version=14 |
| 8 | +current_git_branch=`git rev-parse --abbrev-ref HEAD` |
| 9 | +git_branch=${current_git_branch} |
| 10 | +test_suite=all |
| 11 | +interactive=false |
| 12 | + |
7 | 13 | function print_help { |
8 | 14 | echo "Usage: ${0} [OPTIONS]" |
9 | 15 | echo "" |
10 | 16 | echo "OPTIONS:" |
11 | | - echo " --node-version <version> the node version to use while testing [12]" |
12 | | - echo " --git-branch <branch> the git branch to checkout for testing [the current one]" |
13 | | - echo " --test-suite <suite> which test suite to use ('all', 'behavior', installs', 'kitchensink', 'kitchensink-eject', 'simple') ['all']" |
14 | | - echo " --interactive gain a bash shell after the test run" |
| 17 | + echo " --node-version <version> the node version to use while testing [${node_version}]" |
| 18 | + echo " --git-branch <branch> the git branch to checkout for testing [${current_git_branch}]" |
| 19 | + echo " --test-suite <suite> which test suite to use ('all', 'behavior', installs', 'kitchensink', 'kitchensink-eject', 'simple') ['${test_suite}']" |
| 20 | + echo " --interactive gain a bash shell after the test run [${interactive}]" |
15 | 21 | echo " --help print this message and exit" |
16 | 22 | echo "" |
17 | 23 | } |
18 | 24 |
|
19 | 25 | cd $(dirname $0) |
20 | 26 |
|
21 | | -node_version=14 |
22 | | -current_git_branch=`git rev-parse --abbrev-ref HEAD` |
23 | | -git_branch=${current_git_branch} |
24 | | -test_suite=all |
25 | | -interactive=false |
26 | | - |
27 | 27 | while [ "$1" != "" ]; do |
28 | 28 | case $1 in |
29 | 29 | "--node-version") |
|
84 | 84 | mv /var/create-react-app/patch . |
85 | 85 | git apply patch |
86 | 86 | rm patch |
| 87 | +git add -A |
| 88 | +git commit -m 'Apply local changes' |
87 | 89 | CMD |
88 | 90 |
|
89 | 91 | if [ ${git_branch} != ${current_git_branch} ]; then |
90 | 92 | apply_changes='' |
91 | 93 | fi |
92 | 94 |
|
93 | 95 | read -r -d '' command <<- CMD |
94 | | -echo "prefix=~/.npm" > ~/.npmrc |
95 | | -mkdir ~/.npm |
96 | | -export PATH=\$PATH:~/.npm/bin |
| 96 | +npm install npm@8 -g |
| 97 | +export PATH=\$(npm config get prefix -g)/bin:\$PATH |
97 | 98 | set -x |
98 | 99 | git clone /var/create-react-app create-react-app --branch ${git_branch} |
99 | 100 | cd create-react-app |
100 | 101 | ${apply_changes} |
101 | 102 | node --version |
102 | 103 | npm --version |
| 104 | +npm ci |
103 | 105 | set +x |
104 | 106 | ${test_command} |
105 | 107 | result_code=\$? |
|
0 commit comments