From f6c9e453f88c80dcfcb41c869fb8235c486ef28d Mon Sep 17 00:00:00 2001 From: Reo Date: Tue, 1 Sep 2020 00:27:03 +0900 Subject: [PATCH] Fix `emsdk activate` breaking configuration file (#602) Fixes: #587 > If nodejs is not installed by `emsdk`, the output ".emscripten" file by `emsdk activate` will look like this. > > ```python > NODE_JS = ''/usr/bin/nodejs'' > # too many quotes > ``` > > `emcc` fails to execute by this syntax error. > > I think fixing [this line](https://github.com/emscripten-core/emsdk/blob/1.40.1/emsdk.py#L1450) could be a solution. > > ```python > activated_config['NODE_JS'] = "'%s'" % node_fallback > # the value will be quoted later again > ``` --- emsdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emsdk.py b/emsdk.py index 89e9d68..14ce884 100755 --- a/emsdk.py +++ b/emsdk.py @@ -1452,7 +1452,7 @@ def generate_dot_emscripten(active_tools): node_fallback = which('nodejs') if not node_fallback: node_fallback = 'node' - activated_config['NODE_JS'] = "'%s'" % node_fallback + activated_config['NODE_JS'] = node_fallback for name, value in activated_config.items(): cfg += name + " = '" + value + "'\n"