Commit graph

107 commits

Author SHA1 Message Date
Félix Saparelli
23f05f3985
Clippy in tests 2022-06-01 01:11:26 +12:00
Félix Saparelli
7ce1ac4ee6
Fix syntax 2022-06-01 01:11:26 +12:00
Félix Saparelli
f2905dd46e
Update src/helpers.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-01 01:11:26 +12:00
Félix Saparelli
ac74da4a27
Clippy suggestions 2022-06-01 01:11:26 +12:00
Félix Saparelli
b79d8d7fec
Warn on non-HTTPS url 2022-06-01 00:43:41 +12:00
Félix Saparelli
77b331f97c
Add error codes to documentation 2022-06-01 00:29:18 +12:00
Félix Saparelli
529781a9a9
Format and link version mismatch warning 2022-06-01 00:29:18 +12:00
Félix Saparelli
aa4339e07d
Expose crate::errors module 2022-06-01 00:29:17 +12:00
Félix Saparelli
1cac046ffd
Formatting 2022-06-01 00:29:17 +12:00
Félix Saparelli
dee45f4b81
Correct HTTP error for remote_exists() helper 2022-06-01 00:29:17 +12:00
Félix Saparelli
c83c184983
Default to no if nothing is entered on confirm 2022-06-01 00:29:17 +12:00
Félix Saparelli
52c0213d98
Show prompt for confirm 2022-06-01 00:29:17 +12:00
Félix Saparelli
7f0c818313
Don’t print "Fatal error" for UserAbort 2022-06-01 00:29:17 +12:00
Félix Saparelli
33f4c76826
Add help text for when a crate is not found 2022-06-01 00:29:17 +12:00
Félix Saparelli
84ebc0039e
Pretty-print errors 2022-06-01 00:29:17 +12:00
Félix Saparelli
02c8c0af00
Avoid bare url 2022-06-01 00:29:17 +12:00
Félix Saparelli
bd35c473a9
Use new Termination trait 2022-06-01 00:29:17 +12:00
Félix Saparelli
f56ed6fc4c
Add per-error exit codes 2022-06-01 00:29:17 +12:00
Félix Saparelli
f9e69503b0
Document the library error types 2022-06-01 00:29:17 +12:00
Félix Saparelli
c0eaffb05d
Refactor for rich errors, split user abort and genuine error 2022-06-01 00:29:14 +12:00
Jiahao XU
5b6634def6
Add new variant PkgFmt::Tzstd and update helpers::extract
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-05-31 16:50:55 +10:00
Lea Fairbanks
19d0616324
Add cli overrides 2022-05-31 18:00:07 +12:00
Félix Saparelli
fbf26634c9
Formatting 2022-05-31 17:37:40 +12:00
Félix Saparelli
e8464aba3d
Use tempfile over tempdir
Closes #135
2022-05-31 17:37:34 +12:00
Christof Weickhardt
256e695aa5 feat: remove crates-index dependency 2022-05-01 07:45:23 +00:00
Ryan
26711f3ae6
Merge pull request #125 from somehowchris/fix/package-version-abort-logic
fix: abort install for specific version if not confirmed
2022-05-01 11:44:01 +12:00
Christof Weickhardt
42e327477b fix: abort install for specific version if not confirmed 2022-04-30 09:20:15 +00:00
Christof Weickhardt
5f9c673ea5 fix: ignore crate version if yanked 2022-04-29 11:10:05 +00:00
Félix Saparelli
eeaba76b5f
Fallback to installing from source (#114)
Closes #108
2022-04-29 10:15:43 +12:00
Félix Saparelli
d68b0a209a
Clarify --version usage and add a warning at runtime (#116)
Fixes #113
2022-04-29 09:33:54 +12:00
Félix Saparelli
1757dc5344
Make fetcher creating infallible (#118)
Fixes #109
2022-04-29 09:24:46 +12:00
Félix Saparelli
62ec23e6f4
Use the correct link name (#117)
On windows, but also use templating to render it correctly everywhere.

Fixes #106
Fixes #111
2022-04-29 09:24:19 +12:00
наб
f76791b9b9
Direct the symlink the right way in symlink info!(), point at actual destination 2022-03-13 16:32:58 +01:00
наб
5b4909f9eb
Link to basename instead of absolute path on unix
This renders the link (a) more likely to fit in an ext4 inode
and more importantly (b) makes the bindir impervious to being moved
around
2022-03-13 16:32:55 +01:00
Félix Saparelli
b5d6d68d6d Fix quickinstall failing when packages are not wrapped in a folder 2022-02-16 22:42:37 +13:00
Félix Saparelli
7a1d8b42dd Revert Cargo.toml to {format} to allow self-upgrade 2022-02-16 22:06:03 +13:00
Félix Saparelli
5ef8abda3a Actually implement --dry-run 2022-02-16 17:16:29 +13:00
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
Félix Saparelli
370ae05620
QuickInstall support (#94)
See this issue: https://github.com/alsuren/cargo-quickinstall/issues/27

Quick Install is a hosted repo of built crates, essentially. The approach I've taken here is
a list of strategies:

1. First, we check the crate meta or default and build the URL to the repo. Once we have
   that, we perform a `HEAD` request to the URL to see if it's available.
2. If it's not, we build the URL to the quickinstall repo, and perform a `HEAD` to there.

As soon as we've got a hit, we use that. I've built it so it's extensible with more strategies.
This could be useful for #4.

This also adds a prompt before downloading from third-party sources, and logs a short
name for a source, which is easier to glance than a full URL, and includes a quick refactor
of the install/link machinery.
2022-02-16 14:49:07 +13:00
Félix Saparelli
cdb2f8ccdd Fix test 2021-11-17 21:57:09 +13:00
Félix Saparelli
0f9b4de449 Update deps 2021-11-17 21:53:20 +13:00
pinage404
6f05d630f0 fix: binary need to have the right to be executed 2021-10-17 12:35:15 +02:00
pinage404
90edbba221 fix: binary is not in a extracted folder 2021-10-17 12:34:36 +02:00
ryan kurte
7aaba5e1ee improve debug logging on extraction 2021-10-08 12:16:14 +13:00
ryan
76a7fb00c9 add pkg-url and pkg-fmt overrides 2021-04-08 21:26:44 +12:00
ryan
fcc88a673e remove incorrect default doc line 2021-04-08 18:44:19 +12:00
ryan
1c25b1346f added zip support, pkg-fmt override
swapped CI to build zips for windows
2021-04-08 18:39:54 +12:00
Félix Saparelli
9c06ca94cb
Add support for Txz archives 2021-03-06 22:35:05 +13:00
ryan
501022144b fix test 2020-12-31 17:36:53 +13:00
ryan
dfb80803fa revert default pkg url to use format template 2020-12-31 15:33:43 +13:00