Skip to content

Commit

Permalink
exclude NODE_EMBEDDER_MODULE_VERSION string (#23)
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: #20
Refs: nodejs/node#49279
  • Loading branch information
richardlau authored Oct 16, 2023
1 parent 860a8b4 commit 3c31920
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 3c31920

Please sign in to comment.