Skip to content

Commit 79ce144

Browse files
author
David Hasani
committed
check correct spawnResult fields
1 parent bf625e2 commit 79ce144

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
@@ -748,12 +748,16 @@ export async function getValidSQLConversionCandidateProjects() {
748748
const args = command === 'findstr' ? ['/i', '/s', str] : ['-i', '-r', str]
749749
const spawnResult = spawnSync(command, args, {
750750
cwd: project.path,
751-
shell: true, // TO-DO: better for this to be false? Test on project with a space in the name
751+
shell: false,
752752
encoding: 'utf-8',
753753
})
754-
// in case our search unexpectedly fails, still allow user to transform that project
755-
// also, anything in stdout here means search string was detected
756-
if (spawnResult.status !== 0 || spawnResult.error || spawnResult.stdout.trim()) {
754+
/*
755+
in case the search unexpectedly fails, still allow user to transform that project.
756+
error is set when command fails to spawn; stderr is set when command itself fails.
757+
status of 0 plus anything in stdout means search string was detected.
758+
status will be non-zero and stdout / stderr / error will be empty when search string is not detected.
759+
*/
760+
if (spawnResult.error || spawnResult.stderr || (spawnResult.status === 0 && spawnResult.stdout.trim())) {
757761
embeddedSQLProjects.push(project)
758762
break
759763
}

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)