Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add double quotes to escape spaces in paths in e2e #1707

Merged
merged 3 commits into from
Mar 5, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tasks/e2e-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'`

function cleanup {
echo 'Cleaning up.'
cd $root_path
cd "$root_path"
# Uncomment when snapshot testing is enabled by default:
# rm ./packages/react-scripts/template/src/__snapshots__/App.test.js.snap
rm -rf $temp_cli_path $temp_app_path
rm -rf "$temp_cli_path" $temp_app_path
}

# Error messages are redirected to stderr
Expand Down Expand Up @@ -126,21 +126,21 @@ npm start -- --smoke-test
# ******************************************************************************

# Pack CLI
cd $root_path/packages/create-react-app
cd "$root_path"/packages/create-react-app
cli_path=$PWD/`npm pack`

# Go to react-scripts
cd $root_path/packages/react-scripts
cd "$root_path"/packages/react-scripts

# Save package.json because we're going to touch it
cp package.json package.json.orig

# Replace own dependencies (those in the `packages` dir) with the local paths
# of those packages.
node $root_path/tasks/replace-own-deps.js
node "$root_path"/tasks/replace-own-deps.js

# Finally, pack react-scripts
scripts_path=$root_path/packages/react-scripts/`npm pack`
scripts_path="$root_path"/packages/react-scripts/`npm pack`

# Restore package.json
rm package.json
Expand All @@ -151,12 +151,12 @@ mv package.json.orig package.json
# ******************************************************************************

# Install the CLI in a temporary location
cd $temp_cli_path
npm install $cli_path
cd "$temp_cli_path"
npm install "$cli_path"

# Install the app in a temporary location
cd $temp_app_path
create_react_app --scripts-version=$scripts_path test-app
create_react_app --scripts-version="$scripts_path" test-app
Copy link
Contributor Author

@viankakrisna viankakrisna Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line here still causes error even when wrapped with ""

here's the full log

Compiled successfully!

The app is running at:

  http://localhost:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.

+ cd '/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/create-react-app'
++ npm pack
+ cli_path='/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/create-react-app/create-react-app-1.2.1.tgz'
+ cd '/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/react-scripts'
+ cp package.json package.json.orig
+ node '/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/tasks/replace-own-deps.js'
Replaced local dependencies.
++ npm pack
+ scripts_path='/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/react-scripts/react-scripts-0.9.3.tgz'
+ rm package.json
+ mv package.json.orig package.json
+ cd /var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.VTXHaGfC
+ npm install '/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/create-react-app/create-react-app-1.2.1.tgz'
/private/var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.VTXHaGfC
└─┬ create-react-app@1.2.1 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.1.1 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├─┬ commander@2.9.0 
  │ └── graceful-readlink@1.0.1 
  ├─┬ cross-spawn@4.0.2 
  │ ├─┬ lru-cache@4.0.2 
  │ │ ├── pseudomap@1.0.2 
  │ │ └── yallist@2.0.0 
  │ └─┬ which@1.2.12 
  │   └── isexe@1.1.2 
  ├─┬ fs-extra@1.0.0 
  │ ├── graceful-fs@4.1.11 
  │ ├── jsonfile@2.4.0 
  │ └── klaw@1.3.1 
  ├── semver@5.3.0 
  └─┬ validate-npm-package-name@3.0.0 
    └── builtins@1.0.3 

npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.VTXHaGfC/package.json'
npm WARN tmp.VTXHaGfC No description
npm WARN tmp.VTXHaGfC No repository field.
npm WARN tmp.VTXHaGfC No README data
npm WARN tmp.VTXHaGfC No license field.
+ cd /var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.8YzQUV2S
+ create_react_app '--scripts-version=/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/react-scripts/react-scripts-0.9.3.tgz' test-app
+ node /var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.VTXHaGfC/node_modules/create-react-app/index.js --scripts-version=/Users/adeviankakrisnafadlil/Local Sites/create-react-app-extra/packages/react-scripts/react-scripts-0.9.3.tgz test-app
Creating a new React app in /private/var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.8YzQUV2S/Sites/create-react-app-extra/packages/react-scripts/react-scripts-0.9.3.tgz.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and /Users/adeviankakrisnafadlil/Local...

yarn add v0.21.3
info No lockfile found.
[1/4] 🔍  Resolving packages...
error Couldn't find package "/Users/adeviankakrisnafadlil/Local" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom /Users/adeviankakrisnafadlil/Local has failed.

Deleting generated file... package.json
Deleting react-scripts-0.9.3.tgz/ from /private/var/folders/f9/35kw1ffx64944m7ws1k3ytqh0000gn/T/tmp.8YzQUV2S/Sites/create-react-app-extra/packages/react-scripts
Done.
++ set +x
e2e-simple.sh: ERROR! An error was encountered executing line 159.
Cleaning up.
Exiting with error.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It calls create-react-app in the packages folders and somehow failed to resolve proper path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with npm? Might be a yarn bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to test it with npm? can i disable yarn temporarily on my machine?


# ******************************************************************************
# Now that we used create-react-app to create an app depending on react-scripts,
Expand Down Expand Up @@ -243,10 +243,10 @@ verify_env_url
echo yes | npm run eject

# ...but still link to the local packages
npm link $root_path/packages/babel-preset-react-app
npm link $root_path/packages/eslint-config-react-app
npm link $root_path/packages/react-dev-utils
npm link $root_path/packages/react-scripts
npm link "$root_path"/packages/babel-preset-react-app
npm link "$root_path"/packages/eslint-config-react-app
npm link "$root_path"/packages/react-dev-utils
npm link "$root_path"/packages/react-scripts

# Test the build
npm run build
Expand Down