thom4parisot / grunt-crx

Grunt task used to package private Chrome Extensions.
https://npmjs.com/grunt-crx
MIT License
118 stars 21 forks source link

Allow timestamps in .crx file to be set deterministically #52

Closed jeblackiii closed 9 years ago

jeblackiii commented 9 years ago

Currently the timestamps are set to the current time, which causes the .crx file to be different every time it is rebuilt. It would be nice to have a mechanism to set the dates and permissions like grunt-contrib-compress does, or failing that, to read them from the file stats instead of from the current system time.

jeblackiii commented 9 years ago

On closer examination, this would be kind of pointless at the moment unless you switched to something other than node-archiver as it seems it doesn't guarantee the order of the files in the ZIP file.

thom4parisot commented 9 years ago

You mean you would like the zip file to be timestamped with the same date as the most recent file contained in the archive?

jeblackiii commented 9 years ago

Assuming I'm understanding you correctly, no, the issue is the timestamps (one for each file) recorded in the contents of the ZIP file, not the modification time of the ZIP file itself.

thom4parisot commented 9 years ago

Oh OK, I understand. Why would you alter the modified time of files inside the ZIP file?

jeblackiii commented 9 years ago

My original goal was to have the build process produce the same file, bit for bit, each time I ran it. But now I think it's kind of moot, because I found out that if the ZIP file is built with node-archiver, the order of the files within the ZIP file can change from run to run. You'd have to switch to a different package for building the ZIP files, which is probably too much work for this one use case.

What I ended up doing is building the ZIP files separately with jszip and feeding them to your command-line app for signing.