1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +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:
foxfromworld
2026-03-05 13:55:05 +08:00
committed by GitHub
parent cc5f782d28
commit a1a10c777f
2 changed files with 27 additions and 0 deletions
+26
View File
@@ -91,3 +91,29 @@ To learn how to write regression tests for theme and syntax changes, read the
[Syntax
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
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.