Closed jeblackiii closed 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.
You mean you would like the zip file to be timestamped with the same date as the most recent file contained in the archive?
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.
Oh OK, I understand. Why would you alter the modified time of files inside the ZIP file?
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.
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.