From ed7aea8dd3a4bf920a2ec4ddf6063c6abd7370de Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 23 Nov 2022 10:46:06 -0600 Subject: [PATCH] Add binstall metadata (#7212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description To make `cargo binstall nu` works out of the box, `Cargo.toml` needs to be slightly modified, likely because the URL to the download does not exactly match. # User-Facing Changes None # Tests + Formatting Tested by cherry-picking this commit on top of the 0.71.0 tag, running `cargo package --allow-dirty --no-verify`, then: ``` ~ ❯ cargo binstall --manifest-path ~/src/github/nushell/nushell/Cargo.toml nu --force INFO resolve: Resolving package: 'nu' WARN resolve: The package will be downloaded from github.com INFO resolve: This will install the following binaries: INFO resolve: - nu (nu -> /home/michel/.cargo/bin/nu-v0.71.0) INFO resolve: And create (or update) the following symlinks: INFO resolve: - nu (/home/michel/.cargo/bin/nu -> nu-v0.71.0) Do you wish to continue? yes/[no] ? yes INFO install: Installing binaries... INFO Done in 8.538106765s ``` `--force` was needed because I've previously tried this to manually test the `pkg-url`: ``` cargo binstall \ --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ --pkg-fmt="tgz" nu ``` Fixes #7201. Signed-off-by: Michel Alexandre Salim Signed-off-by: Michel Alexandre Salim --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 9167d882ed..6e5e377c03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,13 @@ version = "0.71.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" +pkg-fmt = "tgz" + +[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] +pkg-fmt = "zip" + [workspace] members = [ "crates/nu-cli",