fix: binary is not in a extracted folder

This commit is contained in:
pinage404 2021-10-17 12:34:36 +02:00
parent 5c56c930e4
commit 90edbba221

View file

@ -199,7 +199,11 @@ async fn main() -> Result<(), anyhow::Error> {
// Generate install paths // Generate install paths
// Source path is the download dir + the generated binary path // Source path is the download dir + the generated binary path
let source_file_path = bin_ctx.render(&meta.bin_dir)?; let source_file_path = bin_ctx.render(&meta.bin_dir)?;
let source = bin_path.join(&source_file_path); let source = if meta.pkg_fmt == PkgFmt::Bin {
bin_path.clone()
} else {
bin_path.join(&source_file_path)
};
// Destination path is the install dir + base-name-version{.format} // Destination path is the install dir + base-name-version{.format}
let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?; let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?;