Skip to content

Commit 8c60e66

Browse files
committed
fix(amazonq): support nested dockerfiles
1 parent 5766e4b commit 8c60e66

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
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: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,6 @@ export const wellKnownCodeFiles = new Set(['Dockerfile', 'Dockerfile.build'])
353353

354354
/** Returns true if `filename` is a code file. */
355355
export function isCodeFile(filename: string): boolean {
356-
if (codefileExtensions.has(path.extname(filename).toLowerCase())) {
357-
return true
358-
} else if (wellKnownCodeFiles.has(filename)) {
359-
return true
360-
} else {
361-
return false
362-
}
356+
const ext = path.extname(filename).toLowerCase()
357+
return codefileExtensions.has(ext) || wellKnownCodeFiles.has(path.basename(filename))
363358
}

0 commit comments

Comments
 (0)