mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-23 02:56:37 +00:00
Improve auto discover (#433)
* Add new field `gh_crate_meta::Context::archive_suffix` * Support `archive_suffix = ""` for unix * Use `archive-suffix` in `FULL_FILENAMES` & `NOVERSION_FILENAMES` to support `PkgFmt::Bin` * Simplify `PkgFmt::extensions` * Fix `default_bin_dir_template` in `infer_bin_dir_template`: Fix typo `archive_suffix` * Test `default_bin_dir_template` in CI * Fix installation of `PkgFmt::Bin`: `chmod +x $bin` on unix if fmt == Bin * Add miniserve to `.github/scripts/tests.sh` * Update `SUPPORT.md` * Add github-test-Cargo2.toml to test Github pkg-url with bin-dir provided * Avoid allocation on processing `path_normalized` in `BinFile::from_product` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
c15903684f
commit
4ba1e221ea
10 changed files with 94 additions and 51 deletions
|
@ -44,16 +44,17 @@ impl PkgFmt {
|
|||
}
|
||||
}
|
||||
|
||||
/// List of possible file extensions for the format.
|
||||
/// List of possible file extensions for the format
|
||||
/// (with prefix `.`).
|
||||
pub fn extensions(self) -> &'static [&'static str] {
|
||||
match self {
|
||||
PkgFmt::Tar => &["tar"],
|
||||
PkgFmt::Tbz2 => &["tbz2", "tar.bz2"],
|
||||
PkgFmt::Tgz => &["tgz", "tar.gz"],
|
||||
PkgFmt::Txz => &["txz", "tar.xz"],
|
||||
PkgFmt::Tzstd => &["tzstd", "tzst", "tar.zst"],
|
||||
PkgFmt::Bin => &["bin", "exe"],
|
||||
PkgFmt::Zip => &["zip"],
|
||||
PkgFmt::Tar => &[".tar"],
|
||||
PkgFmt::Tbz2 => &[".tbz2", ".tar.bz2"],
|
||||
PkgFmt::Tgz => &[".tgz", ".tar.gz"],
|
||||
PkgFmt::Txz => &[".txz", ".tar.xz"],
|
||||
PkgFmt::Tzstd => &[".tzstd", ".tzst", ".tar.zst"],
|
||||
PkgFmt::Bin => &[".bin", ".exe", ""],
|
||||
PkgFmt::Zip => &[".zip"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue