Use source-date-epoch as timestamp source for documentation

Origin: https://salsa.debian.org/js-team/npm/-/merge_requests/7
Forwarded: no
Reviewed-By: Yadd <yadd@debian.org>
Last-Update: 2021-11-27


Gbp-Pq: Name 2020_reproducible_documentation_build.patch
This commit is contained in:
James Addison 2023-02-16 14:46:17 +08:00 committed by zhouganqing
parent 42ebd1aa31
commit 940667d852
1 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,8 @@ fs.readFile(src, 'utf8', function (err, data) {
.replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer) .replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer)
.trim() .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) { if (err) {
return console.log(err) return console.log(err)
} }