Commit 7a3c9ed0 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

If there is only one folder at the root of the zip, consider it as root

parent 9725db2c
......@@ -16,7 +16,22 @@
if (logFunction === undefined) {
logFunction = console.log;
}
var promise_list = [], url_number = 0;
var promise_list = [], url_number = 0, path_list = [], root_path = "", i;
zip.forEach(function (relativePath, zipEntry) {
path_list.push(relativePath);
});
if (path_list) {
root_path = path_list[0].split("/")[0];
}
for (i = 0; i < path_list.length - 1; i++) {
if (root_path !== path_list[i].split("/")[0]) {
root_path = "";
break;
}
}
if (root_path !== "" && !from_path) {
from_path = root_path;
}
zip.forEach(function (relativePath, zipEntry) {
var end_url;
url_number += 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment