Skip to content

Commit a954f49

Browse files
Merge master into feature/postreinvent
2 parents 58e6bbf + 33b791e commit a954f49

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Amazon Q /dev not adding Dockerfiles in nested folders"
4+
}

packages/core/src/shared/filetypes.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,11 @@ export const codefileExtensions = new Set([
350350
'.zig',
351351
])
352352

353-
// Some well-known code files without an extension
354-
export const wellKnownCodeFiles = new Set(['Dockerfile', 'Dockerfile.build'])
353+
// Code file names without an extension
354+
export const codefileNames = new Set(['Dockerfile', 'Dockerfile.build'])
355355

356356
/** Returns true if `filename` is a code file. */
357357
export function isCodeFile(filename: string): boolean {
358-
if (codefileExtensions.has(path.extname(filename).toLowerCase())) {
359-
return true
360-
} else if (wellKnownCodeFiles.has(filename)) {
361-
return true
362-
} else {
363-
return false
364-
}
358+
const ext = path.extname(filename).toLowerCase()
359+
return codefileExtensions.has(ext) || codefileNames.has(path.basename(filename))
365360
}

0 commit comments

Comments
 (0)