Skip to content

Commit

Permalink
fix: Set extension of shim
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Dec 1, 2023
1 parent 82b274a commit e56e809
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 41 deletions.
79 changes: 47 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ name = "cargo-bin"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.40"
clap = "4.3.19"
owo-colors = "3.5.0"
serde = { version = "1.0.149", features = ["derive"] }
toml = "0.5.9"
toml_edit = "0.19.14"
version_check = "0.9.3"
which = "4.4.0"
anyhow = "=1.0.40"
cfg-if = "=1.0.0"
clap = "=4.3.19"
owo-colors = "=3.5.0"
serde = { version = "=1.0.149", features = ["derive"] }
toml = "=0.5.9"
toml_edit = "=0.19.14"
version_check = "=0.9.3"
which = "=4.4.0"

[dev-dependencies]
assert_cmd = "2.0.12"
Expand Down
9 changes: 8 additions & 1 deletion src/shims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::io::Write;
use std::path;

use anyhow::Result;
use cfg_if::cfg_if;

use crate::metadata;

Expand Down Expand Up @@ -77,7 +78,13 @@ pub fn sync() -> Result<()> {
continue;
}

let bin_path = bin_dir.join(&bin);
let mut bin_path = bin_dir.join(&bin);
bin_path.set_extension("");
cfg_if! {
if #[cfg(not(target_family = "unix"))] {
bin_path.set_extension("cmd");
}
}
if bin_path.exists() {
continue;
}
Expand Down

0 comments on commit e56e809

Please sign in to comment.