-
Notifications
You must be signed in to change notification settings - Fork 604
fix: escape path in maven when user inputs a space #5346
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: master
Are you sure you want to change the base?
Conversation
@@ -546,7 +546,7 @@ func addDetectArgs(args []string, config detectExecuteScanOptions, utils detectU | |||
args = append(args, fmt.Sprintf("\"--detect.code.location.name=%v\"", codelocation)) | |||
|
|||
if len(mavenArgs) > 0 && !checkIfArgumentIsInScanProperties(config, "detect.maven.build.command") { | |||
args = append(args, fmt.Sprintf("\"--detect.maven.build.command=%v\"", strings.Join(mavenArgs, " "))) |
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.
Cant users escape the space in path?
|
||
func quoteMavenArgs(args []string) string { | ||
// Quote any argument containing spaces to handle paths properly | ||
quotedArgs := make([]string, len(args)) |
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.
Does this work in all platforms and cases?
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.
We don't own this step :)
|
/it |
} | ||
|
||
for _, test := range tt { | ||
test := test |
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.
What is the use of this directive?
Description
User reported issues when a maven path contains a space. This PR wraps such paths in single quotes.
Checklist