From 74f064ff4427e403ce7fccf78746256a61868b5c Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 13 Oct 2023 10:03:26 -0400 Subject: [PATCH] exclude `NODE_EMBEDDER_MODULE_VERSION` string When extracting the module version from `src/node_version.h`, ignore the line: #define NODE_MODULE_VERSION NODE_EMBEDDER_MODULE_VERSION This will pick up the default value from the header as the official Node.js builds do not define `NODE_EMBEDDER_MODULE_VERSION`. Fixes: https://github.com/nodejs/nodejs-dist-indexer/issues/20 Refs: https://github.com/nodejs/node/pull/49279 --- dist-indexer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist-indexer.js b/dist-indexer.js index 61b44ae..abe76fa 100755 --- a/dist-indexer.js +++ b/dist-indexer.js @@ -325,7 +325,7 @@ function fetchModVersion (gitref, callback) { return callback(err) } - let m = rawData.match(/^#define NODE_MODULE_VERSION\s+([^\s]+)\s+.+$/m) + let m = rawData.match(/^#define NODE_MODULE_VERSION\s+((?!NODE_EMBEDDER_MODULE_VERSION)[^\s]+)\s+.+$/m) version = m && m[1] if (version) {