Skip to content

Commit 89f5e01

Browse files
authored
fix build.js remove comments issue
some user may use git Windows-style line-ending which will result in JSON.parse error.
1 parent c3c510d commit 89f5e01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function build (gyp, argv, callback) {
4646
}
4747
return
4848
}
49-
config = JSON.parse(data.replace(/#.+\n/, ''))
49+
config = JSON.parse(data.replace(/#.+[\n\r]+/, ''))
5050

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

0 commit comments

Comments
 (0)