Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ pub use settings::{opts_with_clap, RunMode};
pub fn run(init: impl FnOnce(&mut VirtualMachine) + 'static) -> ExitCode {
env_logger::init();

// NOTE: This is not a WASI convention. But it will be convenient since POSIX shell always defines it.
#[cfg(target_os = "wasi")]
{
if let Ok(pwd) = env::var("PWD") {
let _ = env::set_current_dir(pwd);
};
}

let (settings, run_mode) = opts_with_clap();

// Be quiet if "quiet" arg is set OR stdin is not connected to a terminal
Expand Down