include ../_config.pug if typeof downloadExtensions == "undefined" - var extensions = `["js", "scss", "hello"]` else - var extensions = [] each ext in downloadExtensions - extensions.push("'" + ext + "'") - extensions = "[" + extensions + "]" - var php = `open($t, ZipArchive::CREATE); foreach($file_list as $f) { $z->addFile($f, preg_replace('/^.*?patterns\\//', '', $f)); } $z->close(); header('Content-type: application/zip'); header(sprintf('Content-Disposition: attachment; filename="%s.zip"', $type)); echo(file_get_contents($t)); ?>`.replace("{{extensions}}", extensions) | !{php}