Skip to content

fix(@angular-devkit/benchmark): Allows the CLI repo to be hosted in a directory with spaces.#16073

Merged
mgechev merged 1 commit intoangular:masterfrom
dgp1130:spaces
Nov 8, 2019
Merged

fix(@angular-devkit/benchmark): Allows the CLI repo to be hosted in a directory with spaces.#16073
mgechev merged 1 commit intoangular:masterfrom
dgp1130:spaces

Conversation

@dgp1130
Copy link
Copy Markdown
Collaborator

@dgp1130 dgp1130 commented Nov 5, 2019

child_process.spawn() with shell: true does not quote its arguments, so any data passed in must be surrounded by quotes to properly include spaces (nodejs/node#5060). This was making tests fail when the repository is checked out to a directory with a space in it.

Easiest solution is to simply not use shell escaping which avoids the whole problem.

Alternatively, we could attempt to wrap every argument in quotes, but that would require escaping any existing quotes, which could cause other problems. In the original PR for this file, I don't see a strong motivation for using shell: true, and all the tests pass without it, so I think the best solution is to just remove this flag.

@dgp1130 dgp1130 requested a review from filipesilva November 5, 2019 20:06
@dgp1130 dgp1130 self-assigned this Nov 5, 2019
dgp1130 added a commit to dgp1130/angular-cli that referenced this pull request Nov 5, 2019
Copy link
Copy Markdown
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

I don't remember why I added shell: true there. If it passes, then LGTM!

@filipesilva filipesilva added the target: patch This PR is targeted for the next patch release label Nov 6, 2019
@alan-agius4
Copy link
Copy Markdown
Collaborator

alan-agius4 commented Nov 6, 2019

Nit: the commit message scope should be @angular-devkit/benchmark instead of @angular-devkit/core since the modified file is benchmark.

… directory with spaces.

child_process.spawn() with `shell: true` does not quote its arguments, so any data passed in must be surrounded by quotes to properly include spaces. This was making tests fail when the repository is checked out to a directory with a space in it.

Easiest solution is to simply not use shell escaping which avoids the whole problem.
@dgp1130 dgp1130 changed the title fix(@angular-devkit/core): Allows the CLI repo to be hosted in a directory with spaces. fix(@angular-devkit/benchmark): Allows the CLI repo to be hosted in a directory with spaces. Nov 6, 2019
@dgp1130
Copy link
Copy Markdown
Collaborator Author

dgp1130 commented Nov 6, 2019

Updated the commit and PR name to use @angular-devkit/benchmark.

I didn't see that option in the list of scopes doc, is that an oversight or are there more allowed scopes than are listed there?

@alan-agius4
Copy link
Copy Markdown
Collaborator

I guess, it's not listed because it's a private package.

@mgechev mgechev merged commit 217eb29 into angular:master Nov 8, 2019
mgechev pushed a commit that referenced this pull request Nov 8, 2019
… directory with spaces. (#16073)

child_process.spawn() with `shell: true` does not quote its arguments, so any data passed in must be surrounded by quotes to properly include spaces. This was making tests fail when the repository is checked out to a directory with a space in it.

Easiest solution is to simply not use shell escaping which avoids the whole problem.
dgp1130 added a commit to dgp1130/angular-cli that referenced this pull request Nov 8, 2019
…ted in a directory with spaces. (angular#16073)"

This reverts commit 217eb29.

Reverting as this is breaking some Windows/CI builds. See angular#16119.
@dgp1130 dgp1130 deleted the spaces branch November 12, 2019 22:07
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants