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

Bug: Error happened when flag containing space #2

Closed
imcuttle opened this issue Sep 29, 2018 · 8 comments
Closed

Bug: Error happened when flag containing space #2

imcuttle opened this issue Sep 29, 2018 · 8 comments

Comments

@imcuttle
Copy link

  • Actual
cli()
  .use('node -e " console.log(\'foo\') "')
  .end((err, { text }) => console.log(text))

Throw following error:

    [eval]:1
    "
    ^
    
    SyntaxError: Invalid or unexpected token
  • Expected
cli()
  .use('node -e " console.log(\'foo\') "')
  .end((err, { text }) => console.log(text))

// log: foo
@mklabs
Copy link
Owner

mklabs commented Sep 29, 2018

Does it raise the same error without a space ? Or is it with node -e ?

@imcuttle
Copy link
Author

It works well without space and quote
repl here

@mklabs
Copy link
Owner

mklabs commented Sep 29, 2018

Thanks! I'll try to work on it this afternoon.

@mklabs
Copy link
Owner

mklabs commented Sep 29, 2018

After further investigating, it is due to quotes, not spaces. Still thinking about if it something that needs to be fixed.

@mklabs
Copy link
Owner

mklabs commented Sep 29, 2018

Okay, there's definitely room for improvements. Don't consider my previous comment ;) Switching to simpler exec instead of spawn seems to fix it, as well as #1

@mklabs mklabs closed this as completed in 7dc85db Sep 29, 2018
@mklabs
Copy link
Owner

mklabs commented Sep 29, 2018

@imcuttle fixed, let me know if you have another issue with it or reopen, same for #1

@imcuttle
Copy link
Author

Wow, It's extremely fast. Thanks!

And when is it released?

@mklabs
Copy link
Owner

mklabs commented Sep 30, 2018

Well ... now ;) I just forgot to publish to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants