Skip to content

Commit ae90b22

Browse files
author
David Hasani
committed
check correct spawnResult fields
1 parent 92dc8b0 commit ae90b22

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/core/src/codewhisperer/commands/startTransformByQ.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,16 @@ export async function getValidSQLConversionCandidateProjects() {
746746
const args = command === 'findstr' ? ['/i', '/s', str] : ['-i', '-r', str]
747747
const spawnResult = spawnSync(command, args, {
748748
cwd: project.path,
749-
shell: true, // TO-DO: better for this to be false? Test on project with a space in the name
749+
shell: false,
750750
encoding: 'utf-8',
751751
})
752-
// in case our search unexpectedly fails, still allow user to transform that project
753-
// also, anything in stdout here means search string was detected
754-
if (spawnResult.status !== 0 || spawnResult.error || spawnResult.stdout.trim()) {
752+
/*
753+
in case the search unexpectedly fails, still allow user to transform that project.
754+
error is set when command fails to spawn; stderr is set when command itself fails.
755+
status of 0 plus anything in stdout means search string was detected.
756+
status will be non-zero and stdout / stderr / error will be empty when search string is not detected.
757+
*/
758+
if (spawnResult.error || spawnResult.stderr || (spawnResult.status === 0 && spawnResult.stdout.trim())) {
755759
embeddedSQLProjects.push(project)
756760
break
757761
}

packages/core/src/codewhisperer/models/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export class ZipManifest {
328328
buildLogs: string = 'build-logs.txt'
329329
version: string = '1.0'
330330
hilCapabilities: string[] = ['HIL_1pDependency_VersionUpgrade']
331-
transformCapabilities: string[] = ['EXPLAINABILITY_V1'] // TO-DO: for SQL conversions, maybe make this = []
331+
transformCapabilities: string[] = ['EXPLAINABILITY_V1']
332332
customBuildCommand: string = 'clean test'
333333
requestedConversions?: {
334334
sqlConversion?: {

0 commit comments

Comments
 (0)