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

nuget updater command is already space-enabled; allow unsafe execution #9092

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Feb 21, 2024

The NuGet updater is invoked with already-escaped command line options, so we can simply call it with allow_unsafe_shell_command: true, otherwise the arguments are double escaped.

Adding that parameter was the real fix, but I also refactored the code a bit to make testing the command line generation easier.

N.b., the helper function run_shell_command only takes a string which it tries to escape and that's where the problem arose; we have to pre-escape our strings to allow for a path with spaces in it, etc., and then tell run_shell_command that we've already escaped everything.

Fixes #8633

@brettfo brettfo requested a review from a team as a code owner February 21, 2024 20:45
@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Feb 21, 2024
Copy link
Contributor

@JamieMagee JamieMagee left a comment

Choose a reason for hiding this comment

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

Approved with some small comments.

@abdulapopoola abdulapopoola merged commit 1deb6a7 into main Feb 22, 2024
67 checks passed
@abdulapopoola abdulapopoola deleted the dev/brettfo/nuget-space-in-path branch February 22, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NuGet update failes when project path contains spaces.
4 participants