Skip to content

Commit

Permalink
fix: still use relative path for manifest when folderPath inputs with…
Browse files Browse the repository at this point in the history
… `./` PE-6975
  • Loading branch information
fedellen committed Oct 16, 2024
1 parent 6db5682 commit 23007f7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/node/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,15 @@ export class TurboAuthenticatedUploadService extends TurboAuthenticatedBaseUploa
}

getRelativePath(file: string, params: TurboUploadFolderParams): string {
return file.replace(
(params as NodeUploadFolderParams).folderPath + '/',
'',
);
let folderPath = (params as NodeUploadFolderParams).folderPath;

// slice leading `./` if exists
if (folderPath.startsWith('./')) {
folderPath = folderPath.slice(2);
}

Check warning on line 94 in src/node/upload.ts

View check run for this annotation

Codecov / codecov/patch

src/node/upload.ts#L93-L94

Added lines #L93 - L94 were not covered by tests

const relativePath = file.replace(folderPath + '/', '');
return relativePath;
}

contentTypeFromFile(file: string): string {
Expand Down

0 comments on commit 23007f7

Please sign in to comment.