Skip to content

Commit 5b1e4d2

Browse files
committed
fix(amazonq): incorrect zip entry path for file scans
1 parent 975f0d0 commit 5b1e4d2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
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": "/review: Zip files are created with the wrong file path for file scans in multifolder workspaces."
4+
}

packages/core/src/codewhisperer/util/zipUtil.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export class ZipUtil {
117117
// Note: workspaceFolder.name is not the same as the file system folder name,
118118
// use the fsPath value instead
119119
const projectName = path.basename(workspaceFolder.uri.fsPath)
120-
const relativePath = vscode.workspace.asRelativePath(uri)
120+
// Set includeWorkspaceFolder to false because we are already manually prepending the projectName
121+
const relativePath = vscode.workspace.asRelativePath(uri, false)
121122
const zipEntryPath = this.getZipEntryPath(projectName, relativePath)
122123
zip.addFile(zipEntryPath, Buffer.from(content, 'utf-8'))
123124

0 commit comments

Comments
 (0)