mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Improve error message when WASMER_DIR is not set
This commit is contained in:
@@ -151,15 +151,21 @@ impl CreateExe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_wasmer_dir() -> anyhow::Result<PathBuf> {
|
||||||
|
Ok(PathBuf::from(
|
||||||
|
env::var("WASMER_DIR").context("Trying to read env var `WASMER_DIR`")?,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
fn get_wasmer_include_directory() -> anyhow::Result<PathBuf> {
|
fn get_wasmer_include_directory() -> anyhow::Result<PathBuf> {
|
||||||
let mut path = PathBuf::from(env::var("WASMER_DIR")?);
|
let mut path = get_wasmer_dir()?;
|
||||||
path.push("include");
|
path.push("include");
|
||||||
Ok(path)
|
Ok(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// path to the static libwasmer
|
/// path to the static libwasmer
|
||||||
fn get_libwasmer_path() -> anyhow::Result<PathBuf> {
|
fn get_libwasmer_path() -> anyhow::Result<PathBuf> {
|
||||||
let mut path = PathBuf::from(env::var("WASMER_DIR")?);
|
let mut path = get_wasmer_dir()?;
|
||||||
path.push("lib");
|
path.push("lib");
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
|||||||
Reference in New Issue
Block a user