Closes#311
Similar to how `bat` does it, we now have a global struct which holds
all the queried system directories. We prefer the XDG directories, but
use the "native" directories as a fallback. This should ensure that when
MacOs users upgrade from an older version, their existing config and
cache are still used. After deleting the old directories, the new ones
should be used by tealdeer automatically.
Since these tests require internet access, they are undesirable in
reproducible builds [1] (and in general, I guess). The overall goal is
to shrink this list to a minimum. At some point we might remove the
feature again and ignore online tests by default. Before putting much
thought into refactoring the remaining tests, we should wait until we
have introduced the `updates.archive_url` option. Then, we could run a
local webserver that serves a known file. Until then, having the feature
already helps discourage using `--update` in tests that don't need it
and allows for quicker test execution locally if wanted.
- [1]: edf04b75c1/pkgs/by-name/te/tealdeer/package.nix (L34-L44)
- Adapt to `thing.paint(style)` API; was `style.paint(thing)`
- Remove `yansi::Paint::enable_windows_ascii()` in style usage decision;
removed in yansi commit b186eb5bfb, which introduced "automatic"
support for Windows: "If support is not available, styling is disabled
and no styling sequences are emitted", fitting the `Auto` option
- Respect `--color=always` even if we know it won't work
---------
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
Right now we only support building with Rustls. However, there are quite
a few architectures that aren't yet supported by "ring" (the crypto
library used by Rustls), for example MIPS, PowerPC or SPARC.
To offer an alternative, I added the "native-tls" feature that can be
used instead of "native-roots". When used, the native TLS stack is used
instead of Rustls (i.e. SChannel on Windows, Secure Transport on macOS
and OpenSSL otherwise).
ansi_term is not actively maintained anymore (see
https://rustsec.org/advisories/RUSTSEC-2021-0139). Replace it with a
suitable alternative.
I looked at termcolor, owo-colors and yansi and picked yansi:
- It is very simple
- It does not do terminal color support checking (we already do that in
tealdeer)
- Its color enum type is almost identical to the one from ansi_term, so
migrating is easy
The only change from a config API point of view is that "purple" is now
renamed to "magenta", but "purple" still works.
To do so, we need to bump the MSRV to 1.56 (released 10/2021). While at
it, I actually bumped it all the way to 1.62, where the latest version,
(1.62.1) has been released on July 19, which is just more than one month
ago. Additionally, I removed `clippy.toml` and instead specified the
MSRV in `Cargo.toml`. This will also print an error when trying to
compile with an older compiler.
As reported in https://github.com/dbrgn/tealdeer/issues/244, some users
on macOS had problems with `rustls-tls-native-roots`. Since we did not
find the root cause of this, we'll build macOS release builds with
`rustls-tls-webpki-roots` instead.
Fixes#244.
By getting rid of the bzip2 and time features, we reduce the number of
dependencies. The official tldr pages archive uses deflate compression,
so that should be sufficient.