Skip to content

Commit

Permalink
Merge branch 'master' into binary-install-update-for-958
Browse files Browse the repository at this point in the history
  • Loading branch information
drager authored Jun 17, 2021
2 parents 5d959e9 + 06bd461 commit cdd733c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ fn prebuilt_url(tool: &Tool, version: &str) -> Result<String, failure::Error> {
},
Tool::CargoGenerate => {
Ok(format!(
"https://github.com/ashleygwilliams/cargo-generate/releases/download/v{0}/cargo-generate-v{0}-{1}.tar.gz",
Krate::new(&Tool::CargoGenerate)?.max_version,
"https://github.com/cargo-generate/cargo-generate/releases/download/v{0}/cargo-generate-v{0}-{1}.tar.gz",
// Krate::new(&Tool::CargoGenerate)?.max_version,
"0.5.1", // latest released binary [#907](https://github.com/rustwasm/wasm-pack/issues/907)
target
))
},
Expand Down Expand Up @@ -257,14 +258,17 @@ pub fn cargo_install(
_ => tool.to_string(),
};
let mut cmd = Command::new("cargo");

cmd.arg("install")
.arg("--force")
.arg(crate_name)
.arg("--version")
.arg(version)
.arg("--root")
.arg(&tmp);

if version != "latest" {
cmd.arg("--version").arg(version);
}

let context = format!("Installing {} with cargo", tool);
child::run(cmd, "cargo install").context(context)?;

Expand All @@ -274,7 +278,7 @@ pub fn cargo_install(
// little renaming here.
let binaries: Result<Vec<&str>, failure::Error> = match tool {
Tool::WasmBindgen => Ok(vec!["wasm-bindgen", "wasm-bindgen-test-runner"]),
Tool::CargoGenerate => Ok(vec!["cargo-genrate"]),
Tool::CargoGenerate => Ok(vec!["cargo-generate"]),
Tool::WasmOpt => bail!("Cannot install wasm-opt with cargo."),
};

Expand Down

0 comments on commit cdd733c

Please sign in to comment.