nodejitsu / nexpect

spawn and control child processes in node.js with ease
http://github.com/nodejitsu/nexpect
Other
290 stars 37 forks source link

Bug: Improper pathname parsing in `nspawn` function #38

Open gitaalekhyapaul opened 3 years ago

gitaalekhyapaul commented 3 years ago

Bug Description:

The pathname parsing in nspawn function does not take into consideration spaces in the pathname.

Consider the following pathname of a CLI application: /home/user/Project Folder/Sub Folder/bin/cli (note the spaces in the pathname)

In the lines 360-362 in nexpect.js, we can see the following code:

Screenshot from 2021-05-13 17-29-03

Suppose we consider our above pathname, we can clearly observe:

This leads to improper pathanme parsing and errors in testing.

Expected Behaviour:

The pathname should be parsed properly even if it contains spaces in it.

gitaalekhyapaul commented 3 years ago

A detailed description of this issue can be found here: aws-amplify/amplify-cli#7324