Skip to content

Commit

Permalink
fix: build.js remove comments issue
Browse files Browse the repository at this point in the history
some user may use git Windows-style line-ending which will result in JSON.parse error.
  • Loading branch information
diegozhu authored and lukekarrys committed Oct 28, 2023
1 parent 4a50fe3 commit 7033e6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function build (gyp, argv) {
}
}

config = JSON.parse(data.replace(/#.+\n/, ''))
config = JSON.parse(data.replace(/#.+\r?\n/, ''))

// get the 'arch', 'buildType', and 'nodeDir' vars from the config
buildType = config.target_defaults.default_configuration
Expand Down

0 comments on commit 7033e6a

Please sign in to comment.