From 7b086bfcbcea9839ee4143af3055d98746ac96a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 09:59:15 +1100 Subject: [PATCH] Update SUPPORT.md on `bin-dir` default (#811) Signed-off-by: Jiahao XU --- SUPPORT.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index d47dc42e..0e567279 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -44,12 +44,24 @@ pkg-fmt = "zip" ### Defaults -By default, `binstall` will try all supported package formats and would have `bin-dir` set to -`"{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"` (where `bin` is the cargo binary name and -`binary-ext` is `.exe` on windows and empty on other platforms). +By default, `binstall` will try all supported package formats and would do the same for `bin-dir`. -All binaries must contain a folder named `{ name }-{ target }-v{ version }` (so that prior binary -files are not overwritten when manually executing `tar -xvf ...`). +It will first extract the archives, then iterate over the following list, finding the first dir +that exists: + + - `{ name }-{ target }-v{ version }` + - `{ name }-{ target }-{ version }` + - `{ name }-{ version }-{ target }` + - `{ name }-v{ version }-{ target }` + - `{ name }-{ target }` + - `{ name }-{ version }` + - `{ name }-v{ version }` + - `{ name }` + +Then it will concat the dir with `"{ bin }{ binary-ext }"` and use that as the final `bin-dir`. + +`name` here is name of the crate, `bin` is the cargo binary name and `binary-ext` is `.exe` +on windows and empty on other platforms). The default value for `pkg-url` will depend on the repository of the package.