From 97897eebd8a297b62a73d43e8cf1fd7828d53ed3 Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Sun, 26 Jan 2025 11:15:17 -0800 Subject: [PATCH] docs(docs-infra): Remove leading path from zipped files. (#59726) In certain circonstances, a leading slash in the file paths created a incorrect unarchived project. fixes #57075 PR Close #59726 --- adev/shared-docs/utils/zip.utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adev/shared-docs/utils/zip.utils.ts b/adev/shared-docs/utils/zip.utils.ts index ee005aa21e2..54da4f76ec1 100644 --- a/adev/shared-docs/utils/zip.utils.ts +++ b/adev/shared-docs/utils/zip.utils.ts @@ -14,6 +14,9 @@ import {zip, strToU8} from 'fflate'; export async function generateZip(files: FileAndContent[]): Promise { const filesObj: Record = {}; files.forEach(({path, content}) => { + if (path.startsWith('/')) { + path = path.slice(1); + } filesObj[path] = typeof content === 'string' ? strToU8(content) : content; });