dev-cmd/cat: support setting bat theme via environment variable
This commit is contained in:
parent
6b3eb93010
commit
721a27d68d
@ -32,6 +32,7 @@ module Homebrew
|
||||
cd HOMEBREW_REPOSITORY
|
||||
pager = if Homebrew::EnvConfig.bat?
|
||||
ENV["BAT_CONFIG_PATH"] = Homebrew::EnvConfig.bat_config_path
|
||||
ENV["BAT_THEME"] = Homebrew::EnvConfig.bat_theme
|
||||
ensure_formula_installed!(
|
||||
"bat",
|
||||
reason: "displaying <formula>/<cask> source",
|
||||
|
||||
@ -44,6 +44,10 @@ module Homebrew
|
||||
description: "Use this as the `bat` configuration file.",
|
||||
default_text: "`$HOME/.config/bat/config`.",
|
||||
},
|
||||
HOMEBREW_BAT_THEME: {
|
||||
description: "Use this as the `bat` theme for syntax highlighting.",
|
||||
default_text: "`$BAT_THEME`.",
|
||||
},
|
||||
HOMEBREW_BOOTSNAP: {
|
||||
description: "If set, use Bootsnap to speed up repeated `brew` calls. "\
|
||||
"A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).",
|
||||
|
||||
2
bin/brew
2
bin/brew
@ -75,7 +75,7 @@ HOMEBREW_LIBRARY="${HOMEBREW_REPOSITORY}/Library"
|
||||
|
||||
# Copy and export all HOMEBREW_* variables previously mentioned in
|
||||
# manpage or used elsewhere by Homebrew.
|
||||
for VAR in BROWSER DISPLAY EDITOR NO_COLOR PATH TMUX DBUS_SESSION_BUS_ADDRESS
|
||||
for VAR in BAT_THEME BROWSER DISPLAY EDITOR NO_COLOR PATH TMUX DBUS_SESSION_BUS_ADDRESS
|
||||
do
|
||||
# Skip if variable value is empty.
|
||||
[[ -z "${!VAR}" ]] && continue
|
||||
|
||||
@ -1953,6 +1953,11 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
|
||||
|
||||
*Default:* `$HOME/.config/bat/config`.
|
||||
|
||||
- `HOMEBREW_BAT_THEME`
|
||||
<br>Use this as the `bat` theme for syntax highlighting.
|
||||
|
||||
*Default:* `$BAT_THEME`.
|
||||
|
||||
- `HOMEBREW_BOOTSNAP`
|
||||
<br>If set, use Bootsnap to speed up repeated `brew` calls. A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).
|
||||
|
||||
|
||||
@ -2772,6 +2772,15 @@ Use this as the \fBbat\fR configuration file\.
|
||||
\fIDefault:\fR \fB$HOME/\.config/bat/config\fR\.
|
||||
.
|
||||
.TP
|
||||
\fBHOMEBREW_BAT_THEME\fR
|
||||
.
|
||||
.br
|
||||
Use this as the \fBbat\fR theme for syntax highlighting\.
|
||||
.
|
||||
.IP
|
||||
\fIDefault:\fR \fB$BAT_THEME\fR\.
|
||||
.
|
||||
.TP
|
||||
\fBHOMEBREW_BOOTSNAP\fR
|
||||
.
|
||||
.br
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user