Skip to content

Commit ca266fa

Browse files
author
David Hasani
committed
fix: add quotes around jar path
1 parent 241160f commit ca266fa

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

packages/core/src/codewhisperer/service/transformByQ/transformMavenHandler.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { throwIfCancelled } from './transformApiHandler'
1313
import { sleep } from '../../../shared/utilities/timeoutUtils'
1414
import path from 'path'
1515
import globals from '../../../shared/extensionGlobals'
16-
import os from 'os'
1716

1817
function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingDirPath: string) {
1918
getLogger().info('CodeTransformation: running mvn clean test-compile with maven JAR')
@@ -23,11 +22,9 @@ function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingD
2322

2423
getLogger().info('CodeTransformation: running Maven extension with JAR')
2524

26-
const quotePath = (p: string) => (os.platform() === 'win32' ? `"${p}"` : p)
27-
2825
const args = [
29-
`-Dmaven.ext.class.path=${quotePath(jarPath)}`,
30-
`-Dcom.amazon.aws.developer.transform.jobDirectory=${quotePath(dependenciesFolderPath)}`,
26+
`-Dmaven.ext.class.path="${jarPath}"`,
27+
`-Dcom.amazon.aws.developer.transform.jobDirectory="${dependenciesFolderPath}"`,
3128
'clean',
3229
'test-compile',
3330
]
@@ -37,14 +34,6 @@ function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingD
3734
environment = { ...process.env, JAVA_HOME: transformByQState.getSourceJavaHome() }
3835
}
3936

40-
getLogger().info(`CodeTransformation: JAVA_HOME = ${environment.JAVA_HOME}`)
41-
getLogger().info(`CodeTransformation: baseCommand = ${baseCommand}`)
42-
getLogger().info(`CodeTransformation: jarPath = ${jarPath}`)
43-
getLogger().info(`CodeTransformation: args = ${args.join(' ')}`)
44-
getLogger().info(
45-
`CodeTransformation: shell info --> SHELL=${process.env.SHELL}, COMSPEC=${process.env.COMSPEC}, PSModulePath=${process.env.PSModulePath ? 'PowerShell' : 'not set'}`
46-
)
47-
4837
const spawnResult = spawnSync(baseCommand, args, {
4938
cwd: workingDirPath,
5039
shell: true,

0 commit comments

Comments
 (0)