Merge pull request #957 from bloveless/master

Re-enable looking in the path Wasm-opt for binaries first.
master
Jesper Håkansson 4 years ago committed by GitHub
commit c9ea9aebbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/wasm_opt.rs

@ -3,7 +3,7 @@
use crate::child;
use crate::install::{self, Tool};
use crate::PBAR;
use binary_install::Cache;
use binary_install::{Cache, Download};
use std::path::Path;
use std::process::Command;
@ -58,6 +58,16 @@ pub fn find_wasm_opt(
cache: &Cache,
install_permitted: bool,
) -> Result<install::Status, failure::Error> {
// First attempt to look up in PATH. If found assume it works.
if let Ok(path) = which::which("wasm-opt") {
PBAR.info(&format!("found wasm-opt at {:?}", path));
match path.as_path().parent() {
Some(path) => return Ok(install::Status::Found(Download::at(path))),
None => {}
}
}
let version = "version_78";
Ok(install::download_prebuilt(
&install::Tool::WasmOpt,

Loading…
Cancel
Save