Skip to content

Commit 20b3917

Browse files
committed
fix: including the initial / when creating the zip causes the zip to be invalid
1 parent 4f023de commit 20b3917

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/FileManager/file-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ export async function getFolderZip(folderPath: string) {
2727
for (const file of files) {
2828
const path = resolve(file.parentPath, file.name);
2929
if (file.isDirectory()) {
30-
zip.folder(path);
30+
zip.folder(path.replace("/", ""));
3131
} else if (file.isFile()) {
3232
const absolutePath = resolve(folderPath, file.parentPath, file.name);
3333
const content = await readFile(absolutePath);
34-
zip.file(path, content);
34+
zip.file(path.replace("/", ""), content);
3535
}
3636
}
3737
return await zip.generateAsync({

0 commit comments

Comments
 (0)