@vscode/vsce 3.2.2-3 → 3.2.2-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/package.js +10 -4
- package/package.json +1 -1
package/out/package.js
CHANGED
|
@@ -1321,11 +1321,17 @@ function writeVsix(files, packagePath) {
|
|
|
1321
1321
|
.catch(err => (err.code !== 'ENOENT' ? Promise.reject(err) : Promise.resolve(null)))
|
|
1322
1322
|
.then(() => new Promise((c, e) => {
|
|
1323
1323
|
const zip = new yazl.ZipFile();
|
|
1324
|
+
const zipOptions = {};
|
|
1325
|
+
// reproducible zip files
|
|
1326
|
+
const sde = process.env.SOURCE_DATE_EPOCH;
|
|
1327
|
+
if (sde) {
|
|
1328
|
+
const epoch = parseInt(sde);
|
|
1329
|
+
zipOptions.mtime = new Date(epoch * 1000);
|
|
1330
|
+
files = files.sort((a, b) => a.path.localeCompare(b.path));
|
|
1331
|
+
}
|
|
1324
1332
|
files.forEach(f => isInMemoryFile(f)
|
|
1325
|
-
? zip.addBuffer(typeof f.contents === 'string' ? Buffer.from(f.contents, 'utf8') : f.contents, f.path, {
|
|
1326
|
-
|
|
1327
|
-
})
|
|
1328
|
-
: zip.addFile(f.localPath, f.path, { mode: f.mode }));
|
|
1333
|
+
? zip.addBuffer(typeof f.contents === 'string' ? Buffer.from(f.contents, 'utf8') : f.contents, f.path, { ...zipOptions, mode: f.mode })
|
|
1334
|
+
: zip.addFile(f.localPath, f.path, { ...zipOptions, mode: f.mode }));
|
|
1329
1335
|
zip.end();
|
|
1330
1336
|
const zipStream = fs.createWriteStream(packagePath);
|
|
1331
1337
|
zip.outputStream.pipe(zipStream);
|