mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-28 08:05:55 +00:00
Docs: clarify PATH requirement and explain highlighted outputs (Fixes… (#3610)
* Docs: clarify PATH requirement and explain highlighted outputs (Fixes #2376) * Update CHANGELOG for PR #3610 * Apply suggestion from @keith-hall Applied reviewer’s suggestion to improve PATH export: safer with quotes and more convenient with $(pwd). Co-authored-by: Keith Hall <keith-hall@users.noreply.github.com> * Docs: clarify PATH setup in CONTRIBUTING.md, remove that section from README.md * Docs: add cross reference to syntax tests step 5 in doc/assets.md --------- Co-authored-by: Keith Hall <keith-hall@users.noreply.github.com>
This commit is contained in:
1 parent
cc5f782d28
commit
a1a10c777f
2 files changed
+27
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
# unreleased
|
# unreleased
|
||||||
|
|
||||||
- Fixed bug caused by using `--plain` and `--terminal-width=N` flags simultaneously, see #3529 (@H4k1l)
|
- Fixed bug caused by using `--plain` and `--terminal-width=N` flags simultaneously, see #3529 (@H4k1l)
|
||||||
|
- Fixed syntax tests path, see #3610 (@foxfromworld)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|||||||
@@ -91,3 +91,29 @@ To learn how to write regression tests for theme and syntax changes, read the
|
|||||||
[Syntax
|
[Syntax
|
||||||
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
|
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
|
||||||
section in `assets.md`.
|
section in `assets.md`.
|
||||||
|
|
||||||
|
### Ensuring bat is available for Syntax tests
|
||||||
|
|
||||||
|
The syntax test script (`tests/syntax-tests/update.sh`) calls `bat` from your PATH and regenerates the highlighted output files under
|
||||||
|
`tests/syntax-tests/highlighted/`. These files are used to verify that syntax highlighting works as expected.
|
||||||
|
|
||||||
|
- If you only built the binaries with:
|
||||||
|
```bash
|
||||||
|
cargo build --bins
|
||||||
|
```
|
||||||
|
|
||||||
|
you need to add the debug build to your PATH from the bat project root before running the tests.
|
||||||
|
See also step 5 in [Syntax
|
||||||
|
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests) for related instructions.
|
||||||
|
```bash
|
||||||
|
export PATH="$PATH:$(pwd)/target/debug"
|
||||||
|
```
|
||||||
|
Otherwise, you will see:
|
||||||
|
```bash
|
||||||
|
Error: Could not execute 'bat'. Please make sure that the executable is available on the PATH.
|
||||||
|
```
|
||||||
|
- If you installed bat with:
|
||||||
|
```bash
|
||||||
|
cargo install --path . --locked
|
||||||
|
```
|
||||||
|
then bat will be available in ~/.cargo/bin (usually already in PATH), and the tests will run without issues.
|
||||||
Reference in new issue
Block a user