diff --git a/packages/amazonq/.changes/next-release/Bug Fix-5f545950-eae0-4ee9-bb41-3c0ac9b7dcb1.json b/packages/amazonq/.changes/next-release/Bug Fix-5f545950-eae0-4ee9-bb41-3c0ac9b7dcb1.json new file mode 100644 index 00000000000..cdddf910441 --- /dev/null +++ b/packages/amazonq/.changes/next-release/Bug Fix-5f545950-eae0-4ee9-bb41-3c0ac9b7dcb1.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "Amazon Q /dev not adding Dockerfiles in nested folders" +} diff --git a/packages/core/src/shared/filetypes.ts b/packages/core/src/shared/filetypes.ts index 1e6027bb12b..2ecf2e8ea97 100644 --- a/packages/core/src/shared/filetypes.ts +++ b/packages/core/src/shared/filetypes.ts @@ -353,11 +353,6 @@ export const wellKnownCodeFiles = new Set(['Dockerfile', 'Dockerfile.build']) /** Returns true if `filename` is a code file. */ export function isCodeFile(filename: string): boolean { - if (codefileExtensions.has(path.extname(filename).toLowerCase())) { - return true - } else if (wellKnownCodeFiles.has(filename)) { - return true - } else { - return false - } + const ext = path.extname(filename).toLowerCase() + return codefileExtensions.has(ext) || wellKnownCodeFiles.has(path.basename(filename)) }