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

Use debug formatter to properly escape arguments for error log #401

Merged
merged 2 commits into from
May 9, 2019

Conversation

charlespierce
Copy link
Contributor

Closes #323

We want to properly quote and escape each command-line argument when writing the error log, so that we don't accidentally display the wrong command (e.g. we don't want notion install "node 10" to turn into notion install node 10). The Debug implementation for OsString already provides this for us, so we can format each argument using {:?} and get the correct quoting and escaping.

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

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

Looks like a good improvement.

@charlespierce charlespierce merged commit f37d890 into volta-cli:master May 9, 2019
@charlespierce charlespierce deleted the escape_command_log branch May 9, 2019 19:41
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

Successfully merging this pull request may close these issues.

Properly escape command line arguments in error log
3 participants