-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve handling of spaces in file paths #1705
Conversation
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.
I think there are some other Invoke-Expression
calls (although, fewer than I thought 🎉)
❯ rg Invoke-Expression
deployment/administration/SRE_Teardown.ps1
86: Invoke-Expression -Command "$scriptPath -shmId $shmId -sreId $sreId"
deployment/administration/SRE_SRD_Remote_Diagnostics.ps1
42:Invoke-Expression -Command "$(Join-Path $PSScriptRoot '..' 'secure_research_environment' 'setup' 'Run_SRE_SRD_Remote_Diagnostics.ps1') -shmId $shmId -sreId $sreId -ipLastOctet $ipLastOctet"
deployment/secure_research_environment/setup/Apply_SRE_Network_Configuration.ps1
113:Invoke-Expression -Command "$(Join-Path $PSScriptRoot Unpeer_SRE_Package_Repositories.ps1) -shmId $shmId -sreId $sreId"
149:Invoke-Expression -Command "$(Join-Path $PSScriptRoot "Configure_External_DNS_Queries.ps1") -shmId $shmId -sreId $sreId"
Can we address those here too?
Scratch that, it is actually broken, will fix that too |
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.'[WIP]'
to the title if needed (if you're not yet ready to merge)../tests/AutoFormat_Powershell.ps1 -TargetPath <path to file or directory>
for Powershell).Replaces
Invoke-Expression
with the call operator&
.Invoke-Expression
does not handle spaces in file paths well without some additional editing of the file path.This leads to errors on Windows systems, for example. The call operator correctly quotes the file path and avoids the issue.
🌂 Related issues
Closes #934
🔬 Tests
Tested deployments on Windows systems where spaces were present in the file path and Linux systems to ensure that new command structure functions correctly on both systems and is robust to file path formatting.