Skip to content

Commit

Permalink
Fixed some unhygienic publish and config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jul 10, 2023
1 parent 111f4bd commit c82effc
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 228 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions tests/integration/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tar = "0.4.38"
flate2 = "1.0.24"
dirs = "4.0.0"
derivative = { version = "^2" }
wasmer-registry = { path = "../../../lib/registry", default-features = false }

[features]
default = ["webc_runner"]
Expand Down
23 changes: 23 additions & 0 deletions tests/integration/cli/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,26 @@ pub fn get_repo_root_path() -> Option<PathBuf> {
}
result
}

pub fn get_wasmer_dir() -> Result<PathBuf, anyhow::Error> {
if let Ok(s) = std::env::var("WASMER_DIR") {
Ok(Path::new(&s).to_path_buf())
} else if let Some(root_dir) = get_repo_root_path().and_then(|root| {
if root.join("package").exists() {
Some(root.join("package"))
} else {
None
}
}) {
Ok(root_dir)
} else {
let home_dir = dirs::home_dir()
.ok_or(anyhow::anyhow!("no home dir"))?
.join(".wasmer");
if home_dir.exists() {
Ok(home_dir)
} else {
Err(anyhow::anyhow!("no .wasmer home dir"))
}
}
}
Loading

0 comments on commit c82effc

Please sign in to comment.