mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-24 15:28:51 +01:00
Add custom theme/syntax detection to info.sh
This commit is contained in:
parent
7b87af1748
commit
e037afeaca
@ -2,6 +2,7 @@
|
||||
_modules=('system' 'bat' 'bat_config' 'bat_wrapper' 'bat_wrapper_function' 'tool')
|
||||
_modules_consented=()
|
||||
|
||||
set -o pipefail
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Modules:
|
||||
@ -9,6 +10,7 @@ _modules_consented=()
|
||||
|
||||
_bat_:description() {
|
||||
_collects "Version information for 'bat'."
|
||||
_collects "Custom syntaxes and themes for 'bat'."
|
||||
}
|
||||
|
||||
_bat_config_:description() {
|
||||
@ -39,6 +41,17 @@ _tool_:description() {
|
||||
_bat_:run() {
|
||||
_out bat --version
|
||||
_out env | grep '^BAT_\|^PAGER='
|
||||
|
||||
local cache_dir="$(bat --cache-dir)"
|
||||
if [[ -f "${cache_dir}/syntaxes.bin" ]]; then
|
||||
_print_command "bat" "--list-languages"
|
||||
echo "Found custom syntax set."
|
||||
fi
|
||||
|
||||
if [[ -f "${cache_dir}/themes.bin" ]]; then
|
||||
_print_command "bat" "--list-themes"
|
||||
echo "Found custom theme set."
|
||||
fi
|
||||
}
|
||||
|
||||
_bat_config_:run() {
|
||||
|
Loading…
Reference in New Issue
Block a user