mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +00:00
the big refactor
This commit is contained in:
parent
5fd78341c8
commit
a6c70b41e2
3 changed files with 90 additions and 52 deletions
|
@ -110,6 +110,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
|||
target: opts.target.clone(),
|
||||
version: package.version.clone(),
|
||||
format: meta.pkg_fmt.to_string(),
|
||||
bin: None,
|
||||
};
|
||||
|
||||
debug!("Using context: {:?}", ctx);
|
||||
|
@ -181,7 +182,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
|||
|
||||
// Generate binary path via interpolation
|
||||
let mut bin_ctx = ctx.clone();
|
||||
bin_ctx.name = base_name.clone();
|
||||
bin_ctx.bin = Some(base_name.clone());
|
||||
|
||||
// Append .exe to windows binaries
|
||||
bin_ctx.format = match &opts.target.clone().contains("windows") {
|
||||
|
@ -195,7 +196,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
|||
let source = bin_path.join(&source_file_path);
|
||||
|
||||
// Destination path is the install dir + base-name-version{.format}
|
||||
let dest_file_path = bin_ctx.render("{ name }-v{ version }{ format }")?;
|
||||
let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?;
|
||||
let dest = install_path.join(dest_file_path);
|
||||
|
||||
// Link at install dir + base name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue