Skip to content

Commit

Permalink
exclude NODE_EMBEDDER_MODULE_VERSION string
Browse files Browse the repository at this point in the history
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: nodejs#20
Refs: nodejs/node#49279
  • Loading branch information
richardlau committed Oct 13, 2023
1 parent d10a601 commit 74f064f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist-indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 74f064f

Please sign in to comment.