diff --git a/.cargo/config.toml b/.cargo/config.toml index d45780a..629ae31 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,5 @@ [alias] +binstall = ["bin", "cargo-binstall"] cmd = ["bin", "cargo-cmd"] deny = ["bin", "cargo-deny"] dist = ["bin", "cargo-dist"] diff --git a/Cargo.toml b/Cargo.toml index 4a6a694..75cc746 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ cargo-husky = { version = "1.5.0", default-features = false, features = ["user-h insta = { version = "1.31.0", features = ["yaml"] } [package.metadata.bin] +cargo-binstall = { version = "1.4.6" } cargo-cmd = { version = "0.3.1" } cargo-deny = { version = "0.13.5" } cargo-dist = { version = "0.1.0-prerelease.10" } diff --git a/src/binary.rs b/src/binary.rs index f561a32..16404df 100644 --- a/src/binary.rs +++ b/src/binary.rs @@ -127,8 +127,11 @@ pub fn install(binary_package: metadata::BinaryPackage) -> Result { .join(binary_package.package.clone()) .join(binary_package.version.clone()); let cache_bin_path = cache_path.join("bin").join(bin_name); + let mut cache_bin_path_win = cache_bin_path.clone(); + cache_bin_path_win.set_extension("exe"); - if !path::Path::new(&cache_bin_path).exists() { + if !path::Path::new(&cache_bin_path).exists() && !path::Path::new(&cache_bin_path_win).exists() + { fs::create_dir_all(&cache_path)?; if binary_package.bin_target.is_none() && binary_package.features.is_none()