Skip to content

Commit ea5e150

Browse files
committed
refactor: BookDeployService to remove file extension from relativePath
1 parent 23eac9e commit ea5e150

File tree

1 file changed

+5
-1
lines changed
  • apps/book-server/src/services/BookDeployService

1 file changed

+5
-1
lines changed

apps/book-server/src/services/BookDeployService/index.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ export class BookDeployService implements Service {
6363
// upload to S3
6464
const promises = targetFiles.map(async (filePath) => {
6565
const body = fs.readFileSync(filePath)
66-
const relativePath = filePath.replace(output, '')
66+
let relativePath = filePath.replace(output, '')
67+
const ext = path.extname(relativePath)
68+
if (ext === '.html' && !relativePath.includes('index.html')) {
69+
relativePath = relativePath.replace('.html', '')
70+
}
6771
const contentType = mime.getType(filePath)
6872
await this.awsS3.uploadFile({
6973
bucketName: this.env.get('bookBucketName'),

0 commit comments

Comments
 (0)