Skip to content

Commit

Permalink
fix: zip file creation of diff release
Browse files Browse the repository at this point in the history
- zip file error handling
- removed unnesesary renaming
  • Loading branch information
rocwind committed Mar 25, 2022
2 parents 10427b9 + 5333c57 commit 4bb074b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/core/services/package-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-lines */
import { EventEmitter } from 'events';
import fs from 'fs';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 0 additions & 4 deletions src/core/utils/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ export function calcAllFileSha256(directoryPath: string): Promise<Record<string,
const data: Record<string, string> = {};
_.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;
});
Expand Down

0 comments on commit 4bb074b

Please sign in to comment.