Skip to content

Commit 8fc0642

Browse files
authored
Fix parsing of the --eval CLI option (#237)
This patch fixes a bug in the CLI option parser that parses the argument to `--eval` twice, causing runtime initialization to interpret the argument as a script path, rather than an inline script. This is currently causing an example invocation in the README to fail: ``` wasmtime -S http starling.wasm -e "console.log('hello world')" ReferenceError: Error loading module "console.log('hello world')" (resolved path "console.log('hello world')"): No such file or directory ```
1 parent 6ecaa72 commit 8fc0642

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/config-parser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ class ConfigParser {
7777
config_->content_script_path.reset();
7878
i++;
7979
}
80-
}
81-
if (args[i] == "-i" || args[i] == "--initializer-script-path") {
80+
} else if (args[i] == "-i" || args[i] == "--initializer-script-path") {
8281
if (i + 1 < args.size()) {
8382
config_->initializer_script_path = mozilla::Some(args[i + 1]);
8483
i++;

0 commit comments

Comments
 (0)