fork of https://github.com/rustwasm/wasm-pack for the needs of NextGraph.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
361 B
14 lines
361 B
//! Getting and configuring wasm-pack's binary cache.
|
|
|
|
use binary_install::Cache;
|
|
use std::env;
|
|
use std::path::Path;
|
|
|
|
/// Get wasm-pack's binary cache.
|
|
pub fn get_wasm_pack_cache() -> Result<Cache, failure::Error> {
|
|
if let Ok(path) = env::var("WASM_PACK_CACHE") {
|
|
Ok(Cache::at(Path::new(&path)))
|
|
} else {
|
|
Cache::new("wasm-pack")
|
|
}
|
|
}
|
|
|