diff --git a/src/core/services/package-manager.ts b/src/core/services/package-manager.ts index bb6e2445..ee3a3ec7 100644 --- a/src/core/services/package-manager.ts +++ b/src/core/services/package-manager.ts @@ -1,4 +1,5 @@ /* eslint-disable max-lines */ +import { EventEmitter } from 'events'; import fs from 'fs'; import os from 'os'; import path from 'path'; @@ -228,6 +229,9 @@ class PackageManager { writeStream.on('error', (error) => { reject(error); }); + (zipFile as unknown as EventEmitter).on('error', (error) => { + reject(error); + }); zipFile.outputStream .pipe(writeStream) .on('error', (error) => { diff --git a/src/core/utils/security.ts b/src/core/utils/security.ts index 6e799c91..b658b76e 100644 --- a/src/core/utils/security.ts +++ b/src/core/utils/security.ts @@ -183,10 +183,6 @@ export function calcAllFileSha256(directoryPath: string): Promise = {}; _.forIn(results, (value, key) => { let relativePath = path.relative(directoryPath, key); - const matchresult = relativePath.match(/(\/|\\).*/); - if (matchresult) { - relativePath = path.join('CodePush', matchresult[0]); - } relativePath = slash(relativePath); data[relativePath] = value; });