Skip to content

Commit

Permalink
use wasi annotation for cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Sep 4, 2024
1 parent 766eb17 commit 3fbffbb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
28 changes: 7 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ wasmer-config = { path = "./lib/config" }
wasmer-wasix = { path = "./lib/wasix" }

# Wasmer-owned crates
webc = { version = "6.0.0-rc1", default-features = false, features = ["package"] }
webc = { version = "6.0.0-rc3", default-features = false, features = ["package"] }
edge-schema = { version = "=0.1.0" }
shared-buffer = "0.1.4"

Expand Down
4 changes: 2 additions & 2 deletions lib/wasix/src/runners/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ impl crate::runners::Runner for WasiRunner {
}
}

if let Some(cwd) = cmd.metadata().annotation::<String>("cwd")? {
env.set_current_dir(PathBuf::from(cwd));
if let Some(cwd) = &wasi.cwd {
env.set_current_dir(cwd);
}

let env = env.build()?;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cli/tests/packages/list-cwd/wasmer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ name = "run"
module = "main"
runner = "wasi"

[command.annotations]
[command.annotations.wasi]
cwd = "/data"

0 comments on commit 3fbffbb

Please sign in to comment.