mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-02 04:33:34 +01:00
973ea984c8
SC2155: Declare and assign separately to avoid masking return values. SC2164: Use cd ... || exit in case cd fails. SC2230: which is non-standard. Use builtin 'command -v' instead.
29 lines
598 B
Bash
Executable File
Vendored
29 lines
598 B
Bash
Executable File
Vendored
#!/usr/bin/env bash
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
|
|
|
if ! command -v hyperfine > /dev/null 2>&1; then
|
|
echo "'hyperfine' does not seem to be installed."
|
|
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
|
exit 1
|
|
fi
|
|
|
|
echo "### Startup time"
|
|
echo
|
|
|
|
hyperfine --warmup 3 bat
|
|
|
|
echo
|
|
echo "### Plain text"
|
|
echo
|
|
|
|
hyperfine --warmup 3 "bat --language txt --paging=never 'test-src/jquery-3.3.1.js'"
|
|
|
|
echo
|
|
echo "### Time to syntax-highlight large files"
|
|
echo
|
|
|
|
for SRC in test-src/*; do
|
|
hyperfine --warmup 3 "bat --style=full --color=always --paging=never '$SRC'"
|
|
done
|