-
Notifications
You must be signed in to change notification settings - Fork 9
[fix] Fix shell special character escaping in CLI file paths CF-2117 #172
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
base: main
Are you sure you want to change the base?
Conversation
Codacy's Analysis Summary0 new issue (≤ 1 medium issue) Review Pull Request in Codacy →
|
Codacy's Analysis Summary0 new issue (≤ 1 medium issue) Review Pull Request in Codacy →
|
Co-authored-by: alerizzo <1328657+alerizzo@users.noreply.github.com>
Co-authored-by: alerizzo <1328657+alerizzo@users.noreply.github.com>
Co-authored-by: alerizzo <1328657+alerizzo@users.noreply.github.com>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
File paths with parentheses and other shell special characters were not escaped when passed to the CLI script, causing command execution failures on macOS and other platforms.
Changes
CodacyCli.preparePathForExec(): Wraps paths in double quotes and escapes$,`,\,"to handle all shell metacharacters safelyWinWSLCodacyCli: Removed duplicate space escaping logic; delegates to parent class after WSL path conversion. Normalized drive letters to lowercaseMacCodacyCli.install(): Removed redundant double quotes sincepreparePathForExec()now returns quoted pathsExample
Before:
After:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
artifacts.codacy.com/usr/bin/curl curl REDACTED -o ./api-v3/api-swagger.yaml --create-dirs(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.