jam411 před 3 roky
rodič
revize
4499b1efa1
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      packages/app/src/server/service/plugin.ts

+ 2 - 1
packages/app/src/server/service/plugin.ts

@@ -85,10 +85,11 @@ export class PluginService {
     const unzip = async(zipFilePath: fs.PathLike, unzippedPath: fs.PathLike) => {
       const stream = fs.createReadStream(zipFilePath);
       const unzipStream = stream.pipe(unzipper.Extract({ path: unzippedPath }));
+      const deleteZipFile = (path: fs.PathLike) => fs.unlink(path, (err) => { return err });
 
       try {
         await streamToPromise(unzipStream);
-        fs.unlink(zipFilePath, (err) => { return err });
+        deleteZipFile(zipFilePath);
       }
       catch (err) {
         return err;