mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
tools: fix config serialization w/ long strings
So that “config.gypi” gets serialized correctly in cases such as:
./configure --v8-options='--write-protect-code-memory \
--wasm-write-protect-code-memory'
Where “v8_options” gets prettyprinted into a multiline string.
PR-URL: https://github.com/nodejs/node/pull/35982
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
a81dc9ae18
commit
49649a499e
1 file changed
+3
-1
+3
-1
@@ -163,9 +163,11 @@ def handle_config_gypi(config_filename):
|
||||
def jsonify(config):
|
||||
# 1. string comments
|
||||
config = re.sub(r'#.*?\n', '', config)
|
||||
# 2. join multiline strings
|
||||
config = re.sub(r"'$\s+'", '', config, flags=re.M)
|
||||
# 3. normalize string literals from ' into "
|
||||
config = re.sub('\'', '"', config)
|
||||
# 2. turn pseudo-booleans strings into Booleans
|
||||
# 4. turn pseudo-booleans strings into Booleans
|
||||
config = re.sub('"true"', 'true', config)
|
||||
config = re.sub('"false"', 'false', config)
|
||||
return config
|
||||
|
||||
Reference in new issue
Block a user