We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59d4a24 commit ce8e090Copy full SHA for ce8e090
packages/cubejs-cli/DeployDir.js
@@ -39,14 +39,10 @@ class DeployDir {
39
fileHash(file) {
40
return new Promise((resolve, reject) => {
41
const hash = crypto.createHash('sha1');
42
- return fs.createReadStream(file)
43
- .pipe(hash.setEncoding('hex'))
44
- .on('finish', () => {
45
- resolve(hash.digest('hex'));
46
- })
47
- .on('error', (err) => {
48
- reject(err);
49
- });
+ const stream = fs.createReadStream(file);
+ stream.on('error', err => reject(err));
+ stream.on('data', chunk => hash.update(chunk));
+ stream.on('end', () => resolve(hash.digest('hex')));
50
});
51
}
52
0 commit comments