| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,7 +167,7 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => { | |||
| 167 | 167 | } | |
| 168 | 168 | }, | |
| 169 | 169 | ||
| 170 | - // Unzips zip URL to data/<uuid>/ (if any) | ||
| 170 | + // Unzips zip URL to tmp/<uuid>/ (if any) | ||
| 171 | 171 | cb => { | |
| 172 | 172 | if (req.body.zipurl) { | |
| 173 | 173 | let archive = "zipurl.zip"; | |
@@ -177,23 +177,7 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => { | |||
| 177 | 177 | else{ | |
| 178 | 178 | let archiveDestPath = path.join(dstPath, archive); | |
| 179 | 179 | ||
| 180 | - download(req.body.zipurl, archiveDestPath, err => { | ||
| 181 | - if (err) cb(err); | ||
| 182 | - else{ | ||
| 183 | - // unzip and flatten the zip file (in case there are folders in the zip) | ||
| 184 | - // fs.createReadStream(archiveDestPath).pipe(unzip.Parse()) | ||
| 185 | - // .on('entry', function(entry) { | ||
| 186 | - // if (entry.type === 'File') { | ||
| 187 | - // entry.pipe(fs.createWriteStream(path.join(srcPath, path.basename(entry.path)))); | ||
| 188 | - // } else { | ||
| 189 | - // entry.autodrain(); | ||
| 190 | - // } | ||
| 191 | - // }) | ||
| 192 | - // .on('close', cb) | ||
| 193 | - // .on('error', cb); | ||
| 194 | - cb(); | ||
| 195 | - } | ||
| 196 | - }); | ||
| 180 | + download(req.body.zipurl, archiveDestPath, cb); | ||
| 197 | 181 | } | |
| 198 | 182 | }); | |
| 199 | 183 | } else { | |
@@ -213,8 +197,6 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => { | |||
| 213 | 197 | else { | |
| 214 | 198 | async.eachSeries(entries, (entry, cb) => { | |
| 215 | 199 | if (/\.zip$/gi.test(entry)) { | |
| 216 | - | ||
| 217 | - | ||
| 218 | 200 | fs.createReadStream(path.join(destImagesPath, entry)).pipe(unzip.Parse()) | |
| 219 | 201 | .on('entry', function(entry) { | |
| 220 | 202 | if (entry.type === 'File') { | |
@@ -632,4 +614,4 @@ async.series(commands, err => { | |||
| 632 | 614 | logger.error("Error during startup: " + err.message); | |
| 633 | 615 | process.exit(1); | |
| 634 | 616 | } | |
| 635 | - }); | ||
| 617 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments