skhatri / grunt-nexus-deployer

Nexus Artifact deployer from grunt against snapshot and release repositories.
MIT License
13 stars 69 forks source link

Read artifact before md5 fail with large file #29

Open jeanmaximepelletier opened 8 years ago

jeanmaximepelletier commented 8 years ago

Hi,

This part of the plugin fail if you have a large artifact size. In my case in begain to fail at around 300mb.

I think that replacing the full read in a var with a md5 and sha based on a stream would solve the problem.

Here is the code in problem here :

var artifactData = fs.readFileSync(options.artifact, {encoding: 'binary'});
fs.writeFileSync(pomDir + '/artifact.' + options.packaging + '.md5', md5(artifactData));
fs.writeFileSync(pomDir + '/artifact.' + options.packaging + '.sha1', sha1(artifactData));

Thanks

raphaelparent commented 8 years ago

@skhatri Created a PR for the gulp alternative of this module. You can take a look at it, it fixes to problems on our end.