From 90edbba221cdaca3c78595e8bbcfc96ca6bad400 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:34:36 +0200 Subject: [PATCH 1/3] fix: binary is not in a extracted folder --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e232eee6..0bbd3ec8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -199,7 +199,11 @@ async fn main() -> Result<(), anyhow::Error> { // Generate install paths // Source path is the download dir + the generated binary path 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} let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?; From 6f05d630f040e0048b12e825c4a79535ba5d8ee1 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:35:15 +0200 Subject: [PATCH 2/3] fix: binary need to have the right to be executed --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0bbd3ec8..88e4dd75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -239,6 +239,12 @@ async fn main() -> Result<(), anyhow::Error> { for (_name, source, dest, _link) in &bin_files { // TODO: check if file already exists std::fs::copy(source, dest)?; + + #[cfg(target_family = "unix")] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(dest, std::fs::Permissions::from_mode(0o755))?; + } } // Generate symlinks From 71c6b0d20952f6975546a70948f63953a1f088af Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:45:53 +0200 Subject: [PATCH 3/3] fix: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfa5cdea..8850774a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ yes `binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. -To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml. As an example, the default configuration would be: +To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml`. As an example, the default configuration would be: ```toml [package.metadata.binstall]