From 940667d852b26cb40d789ae123ed3fc38c5413d1 Mon Sep 17 00:00:00 2001 From: James Addison Date: Thu, 16 Feb 2023 14:46:17 +0800 Subject: [PATCH] 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 Last-Update: 2021-11-27 Gbp-Pq: Name 2020_reproducible_documentation_build.patch --- scripts/docs-build.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/docs-build.js b/scripts/docs-build.js index 63658c7..f786e59 100644 --- a/scripts/docs-build.js +++ b/scripts/docs-build.js @@ -36,7 +36,8 @@ fs.readFile(src, 'utf8', function (err, data) { .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) }