cargo-binstall/Cargo.toml
Félix Saparelli 6dcb1dd1b4
Split {format} and allow use of {binary-ext} in pkg-url (#95)
This from feedback in #19:

> wrt. bin-dir and bin-path, this appears to be a typo / should all be called bin-dir

This is only a readme fix afaict, I changed all occurences of `bin-path` in there to `bin-dir`.

> wrt. format, those are actually two (unfortunately named) different concepts, the first
refers to the archive format (eg. .tgz), the second to the binary format (which needs a .exe
appended for windows).

This introduces two new substitutions:
- `binary-ext` is the old "`format` in `bin-dir`"
- `archive-format` is the old "`format` in `pkg-url`"

Contents are unchanged: `binary-ext` includes the dot, `archive-format` doesn't. That
makes it easy to upgrade and also personally I slightly prefer it that way.

The old contextual `format` is still available, "soft deprecated": it will be accepted silently
so everything will work, but all documentation will use the new syntax. In the future we
could move to a "hard deprecated" model where installing a package that uses `format`
will warn the user / tell them to report that to the maintainer. I don't think we'll ever really
be able to remove it but that should be good enough.

A cool new feature is that `binary-ext` is now usable in `pkg-url`, which will be useful for raw binary downloads:

```toml
pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }"
```

I've also added a bunch of tests to GhCrateMeta around the templating for `pkg-url`.
2022-02-16 16:18:35 +13:00

47 lines
1.2 KiB
TOML

[package]
name = "cargo-binstall"
description = "Rust binary package installer for CI integration"
repository = "https://github.com/ryankurte/cargo-binstall"
documentation = "https://docs.rs/cargo-binstall"
version = "0.5.0"
authors = ["ryan <ryan@kurte.nz>"]
edition = "2018"
license = "GPL-3.0"
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }"
bin-dir = "{ bin }{ binary-ext }"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-fmt = "zip"
[dependencies]
crates_io_api = "0.8.0"
cargo_metadata = "0.14.1"
tinytemplate = "1.2.1"
tokio = { version = "1.16.1", features = [ "full" ] }
log = "0.4.14"
structopt = "0.3.26"
simplelog = "0.11.2"
anyhow = "1.0.53"
reqwest = { version = "0.11.9", features = [ "rustls-tls" ], default-features = false }
tempdir = "0.3.7"
flate2 = "1.0.22"
tar = "0.4.38"
cargo_toml = "0.11.4"
serde = { version = "1.0.136", features = [ "derive" ] }
strum_macros = "0.23.1"
strum = "0.23.0"
dirs = "4.0.0"
crates-index = "0.18.5"
semver = "1.0.5"
xz2 = "0.1.6"
zip = "0.5.13"
async-trait = "0.1.52"
url = "2.2.2"
[dev-dependencies]
env_logger = "0.9.0"