Skip to content

Commit 9799c0c

Browse files
committed
fix bug on s3 prefix stripping
1 parent 7788b10 commit 9799c0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/stacks/actions/StackActionOperations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export async function processChangeSet(
9393
let templateS3Url: string | undefined;
9494
try {
9595
if (params.s3Bucket) {
96-
const s3KeyPrefix = params.s3Key ? params.s3Key.slice(0, params.s3Key.lastIndexOf('/')) : undefined;
96+
const s3KeyPrefix = params.s3Key?.includes('/')
97+
? params.s3Key.slice(0, params.s3Key.lastIndexOf('/'))
98+
: undefined;
9799
const template = new ArtifactExporter(s3Service, document.documentType, document.uri, document.contents());
98100

99101
const exportedTemplate = await template.export(params.s3Bucket, s3KeyPrefix);

0 commit comments

Comments
 (0)