Skip to content

Commit

Permalink
Try #305:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] committed Mar 28, 2019
2 parents 2982e6e + 9478ba7 commit 048ba54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bin/wasmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
};

// TODO: refactor this
#[cfg(not(features = "wasi"))]
#[cfg(not(feature = "wasi"))]
let (_abi, import_object, _em_globals) = if wasmer_emscripten::is_emscripten_module(&module) {
let mut emscripten_globals = wasmer_emscripten::EmscriptenGlobals::new(&module);
(
Expand All @@ -219,14 +219,18 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
)
};

#[cfg(features = "wasi")]
#[cfg(feature = "wasi")]
let (_abi, import_object) = if wasmer_wasi::is_wasi_module(&module) {
(
InstanceABI::WASI,
wasmer_wasi::generate_import_object(
options.args.iter().map(|arg| arg.into_bytes()).collect(),
env::vars()
options
.args
.iter()
.cloned()
.map(|arg| arg.into_bytes())
.collect(),
env::vars()
.map(|(k, v)| format!("{}={}", k, v).into_bytes())
.collect(),
),
Expand Down

0 comments on commit 048ba54

Please sign in to comment.