jdaugherty commented on code in PR #16165:
URL: https://github.com/apache/grails-core/pull/16165#discussion_r4289890057


##########
grails-forge/grails-forge-cli/src/test/groovy/org/grails/forge/cli/CommandSpec.groovy:
##########
@@ -60,7 +60,9 @@ class CommandSpec extends Specification {
         } else {
             gradleCommand.append('./gradlew')
         }
-        gradleCommand.append(' --no-daemon -S ').append(command)
+        gradleCommand.append(' --no-daemon -S ')
+        GeneratedBuild.arguments().each { String argument -> 
gradleCommand.append(argument).append(' ') }

Review Comment:
   [P2] Preserve the init-script path as a single process argument
   
   When Forge runs with `-PgrailsIndy=false`, `GeneratedBuild.arguments()` 
contains the absolute checkout path to the init script. Joining it into this 
string loses its argument boundary: `executeCommand()` subsequently calls 
`split(" ")` before constructing `ProcessBuilder`. A checkout such as 
`/work/Grails Sources/grails-core` therefore passes `/work/Grails` as the 
init-script path and the remainder as another argument, so generated-app builds 
fail before executing their tasks. Please assemble and pass a `List<String>` 
through to `ProcessBuilder`, retaining the init-script path as one element; 
adding quotes to the string will not fix the existing split. A path-with-spaces 
regression case would cover this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to