Skip to content

Commit

Permalink
fix: Fix the prefix used to delete from s3 when unpublishing packages (
Browse files Browse the repository at this point in the history
  • Loading branch information
leometzger authored May 12, 2021
1 parent a54c18c commit 6b1a28d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-pants-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'verdaccio-aws-s3-storage': patch
---

Fix the prefix used to delete from s3 when unpublishing packages
2 changes: 1 addition & 1 deletion packages/plugins/aws-storage/src/s3PackageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class S3PackageManager implements ILocalPackageManager {
this.s3,
{
Bucket: this.config.bucket,
Prefix: `${this.packagePath}`,
Prefix: addTrailingSlash(this.packagePath),
},
function (err) {
if (err && is404Error(err as VerdaccioError)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe('S3PackageManager with mocked s3', function () {
expect(mockListObject).toHaveBeenCalledWith(
{
Bucket: 'test-bucket',
Prefix: 'testKeyPrefix/@company/test-package',
Prefix: 'testKeyPrefix/@company/test-package/',
},
expect.any(Function)
);
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('S3PackageManager with mocked s3', function () {
expect(mockListObject).toHaveBeenCalledWith(
{
Bucket: 'test-bucket',
Prefix: 'testKeyPrefix/customFolder/@company/test-package',
Prefix: 'testKeyPrefix/customFolder/@company/test-package/',
},
expect.any(Function)
);
Expand Down

0 comments on commit 6b1a28d

Please sign in to comment.