aboutsummaryrefslogtreecommitdiffstats
path: root/main/npm/reproducible-documentation-build.patch
blob: 1021a15a310d4b34d825480187605196586bf716 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Use source-date-epoch as timestamp source for documentation
Author: James Addison <jay+salsa@jp-hosting.net>
Origin: https://salsa.debian.org/js-team/npm/-/merge_requests/7
Forwarded: no
Last-Update: 2021-06-13

Patch-Source: https://sources.debian.org/src/npm/7.5.2+ds-2/debian/patches/2020_reproducible_documentation_build.patch

--- a/scripts/docs-build.js
+++ b/scripts/docs-build.js
@@ -34,7 +34,8 @@
     .replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer)
     .trim()
 
-  fs.writeFile(dest, marked(result), 'utf8', function (err) {
+  var date = new Date(process.env.SOURCE_DATE_EPOCH)
+  fs.writeFile(dest, marked(result, {date}), 'utf8', function (err) {
     if (err)
       return console.log(err)
   })