mirror of https://github.com/nodejs/node.git
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>pull/35961/head
parent
35274cbddf
commit
f6ada622b7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue