Add custom theme/syntax detection to info.sh

This commit is contained in:
Ethan P 2020-03-03 13:28:26 -08:00 committed by David Peter
parent 7b87af1748
commit e037afeaca
1 changed files with 18 additions and 5 deletions

View File

@ -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() {