-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
chore: wrap the projectDir in quotes if it contains spaces #6594
Conversation
🦋 Changeset detectedLatest commit: 8477bd8 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
if (projectDir.includes(' ')) { | ||
projectDir = `"${projectDir}"`; | ||
} | ||
const enter = [ | ||
`\n${prefix}Enter your project directory using`, | ||
color.cyan(`cd ./${projectDir}`, ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use a real shell-quoting function like quote(["cd", `./${projectDir}`])
from the shell-quote library, rather than a one-off hack for just one of many shell metacharacters that might be misinterpreted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this only shows a hint of what to do next, and it's unlikely that someone would name their project with $
and '
etc, I think this is enough. It feels overkill to bring in a library for this.
Co-authored-by: Bjorn Lu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fill the template around testing? If you tested manually, perhaps you could attach a screenshot/video
@ematipico I added a screenshot #6594 (comment) |
* [ci] release * nit: typo in #6594 changeset --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ben Holmes <[email protected]>
Changes
When outputting projectDir in the terminal, if it contains spaces, wrap it in quotes.
Testing
Docs