Skip to content

Commit

Permalink
Make node version check more robust in e2e.sh
Browse files Browse the repository at this point in the history
I noticed that when running `./tasks/e2e.sh`, the node version check was
failing to execute properly due to bash complaining (version
'3.2.57(1)-release' on my Mac OSX machine). Once I changed the test syntax
to use '[[', I found that sed wasn't stripping the node version correctly.
I verified this with:

    nvm use 0.10
    ./tasks/e2e.sh

...which bombed out on a 'const' declaration'. It's probably down to some
platform peculiarities, but good to fix them nonetheless.
  • Loading branch information
pugnascotia committed Feb 13, 2017
1 parent c9bc6ce commit b558514
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/e2e-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ root_path=$PWD
npm install

# If the node version is < 4, the script should just give an error.
if [ `node --version | sed -e 's/^v//' -e 's/\..\+//g'` -lt 4 ]
if [[ `node --version | sed -e 's/^v//' -e 's/\..*//g'` -lt 4 ]]
then
cd $temp_app_path
err_output=`node "$root_path"/packages/create-react-app/index.js test-node-version 2>&1 > /dev/null || echo ''`
Expand Down

0 comments on commit b558514

Please sign in to comment.