mklabs / gentle-cli

CLI assertions made easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Error happened when flag containing space

imcuttle opened this issue · comments

  • 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

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

It works well without space and quote
repl here

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

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

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

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

Wow, It's extremely fast. Thanks!

And when is it released?

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