From 777daa10ad6896b5cfe161721120d4d7e00c3d32 Mon Sep 17 00:00:00 2001 From: Andre Wanlin Date: Sun, 31 Oct 2021 19:56:06 -0500 Subject: [PATCH] Fixed s3 path join to work under any os Signed-off-by: Andre Wanlin --- .changeset/tender-bugs-sort.md | 5 +++++ packages/techdocs-common/src/stages/publish/awsS3.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tender-bugs-sort.md diff --git a/.changeset/tender-bugs-sort.md b/.changeset/tender-bugs-sort.md new file mode 100644 index 0000000000..b6ad29ba66 --- /dev/null +++ b/.changeset/tender-bugs-sort.md @@ -0,0 +1,5 @@ +--- +'@backstage/techdocs-common': patch +--- + +Updated to properly join URL segments under any OS diff --git a/packages/techdocs-common/src/stages/publish/awsS3.ts b/packages/techdocs-common/src/stages/publish/awsS3.ts index 29eecb8d03..5606ff1fd4 100644 --- a/packages/techdocs-common/src/stages/publish/awsS3.ts +++ b/packages/techdocs-common/src/stages/publish/awsS3.ts @@ -357,7 +357,7 @@ export class AwsS3Publish implements PublisherBase { : lowerCaseEntityTripletInStoragePath(decodedUriNoRoot); // Re-prepend the root path to the relative file path - const filePath = path.join(this.bucketRootPath, filePathNoRoot); + const filePath = path.posix.join(this.bucketRootPath, filePathNoRoot); // Files with different extensions (CSS, HTML) need to be served with different headers const fileExtension = path.extname(filePath);