From 6588f8f26a6ec467133a01c90da1becea0edc1da Mon Sep 17 00:00:00 2001 From: keegan morrissey Date: Thu, 17 Aug 2023 11:50:00 -0500 Subject: [PATCH 1/2] Gradle fix for spaces on commands --- build/gradle.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/gradle.go b/build/gradle.go index 4534dd76..c2718a68 100644 --- a/build/gradle.go +++ b/build/gradle.go @@ -119,7 +119,7 @@ func (gm *GradleModule) createGradleRunConfig() (*gradleRunConfig, error) { env: gm.gradleExtractorDetails.props, gradle: gradleExecPath, extractorPropsFile: extractorPropsFile, - tasks: strings.Join(gm.gradleExtractorDetails.tasks, " "), + tasks: gm.gradleExtractorDetails.tasks, initScript: gm.gradleExtractorDetails.initScript, logger: gm.containingBuild.logger, }, nil @@ -175,7 +175,7 @@ func GetGradleExecPath(useWrapper bool) (string, error) { type gradleRunConfig struct { gradle string extractorPropsFile string - tasks string + tasks []string initScript string env map[string]string logger utils.Log @@ -187,7 +187,7 @@ func (config *gradleRunConfig) GetCmd() *exec.Cmd { if config.initScript != "" { cmd = append(cmd, "--init-script", config.initScript) } - cmd = append(cmd, strings.Split(config.tasks, " ")...) + cmd = append(cmd, config.tasks...) config.logger.Info("Running gradle command:", strings.Join(cmd, " ")) return exec.Command(cmd[0], cmd[1:]...) } From 13b3d70ff8b85328834799b4751c3c170f3550f7 Mon Sep 17 00:00:00 2001 From: keegan morrissey Date: Thu, 17 Aug 2023 11:51:20 -0500 Subject: [PATCH 2/2] go fmt --- build/utils/npm_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/utils/npm_test.go b/build/utils/npm_test.go index b0bb6e81..c97eec13 100644 --- a/build/utils/npm_test.go +++ b/build/utils/npm_test.go @@ -296,7 +296,7 @@ func TestGetConfigCacheNpmIntegration(t *testing.T) { // 2. node_module doesn't exist in the project and generating dependencies needs package-lock. func validateDependencies(t *testing.T, projectPath string, npmArgs []string) { // Install dependencies in the npm project. - _, _, err := RunNpmCmd("npm", projectPath, AppendNpmCommand(npmArgs,"ci"), logger) + _, _, err := RunNpmCmd("npm", projectPath, AppendNpmCommand(npmArgs, "ci"), logger) assert.NoError(t, err) // Calculate dependencies.