From fdd88e0af62bd7d9702f5743b7f68d03a1483a2f Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Thu, 24 Jun 2021 03:07:31 +0100 Subject: [PATCH] bugfix for zip export --- git-tutorial.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git-tutorial.js b/git-tutorial.js index de9da3d..1b0aee1 100644 --- a/git-tutorial.js +++ b/git-tutorial.js @@ -600,9 +600,12 @@ function ___copyzip_click(id) { } if (fs[paths[i]] === null) { // directory - h.subfolders[path_components[path_components.length - 1]] = { - subfolders: {}, - files: [] + var last_component = path_components[path_components.length - 1]; + if (!h.subfolders.hasOwnProperty(last_component)) { + h.subfolders[last_component] = { + subfolders: {}, + files: [] + }; } } else { // file