mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-26 09:43:51 +01:00
Fix broken resolv.conf highlighting
closes #1510 The change in `create_highlighted_versions.py` fixes a "unknown theme "'1337'" warning. The single quotes were wrong. `bat` was always falling back to the default theme, so let's use that for now.
This commit is contained in:
parent
0e5ea9c354
commit
94496df3b0
@ -57,6 +57,11 @@ impl<'a> SyntaxMapping<'a> {
|
|||||||
.insert("*.conf", MappingTarget::MapToUnknown)
|
.insert("*.conf", MappingTarget::MapToUnknown)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// Re-insert a mapping for resolv.conf, see #1510
|
||||||
|
mapping
|
||||||
|
.insert("resolv.conf", MappingTarget::MapTo("resolv"))
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
for glob in &[
|
for glob in &[
|
||||||
"/etc/nginx/**/*.conf",
|
"/etc/nginx/**/*.conf",
|
||||||
"/etc/nginx/sites-*/**/*",
|
"/etc/nginx/sites-*/**/*",
|
||||||
|
@ -12,7 +12,7 @@ BAT_OPTIONS = [
|
|||||||
"--no-config",
|
"--no-config",
|
||||||
"--style=plain",
|
"--style=plain",
|
||||||
"--color=always",
|
"--color=always",
|
||||||
"--theme='1337'",
|
"--theme=default",
|
||||||
"--italic-text=always",
|
"--italic-text=always",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -41,7 +41,9 @@ def create_highlighted_versions(output_basepath):
|
|||||||
root = os.path.dirname(os.path.abspath(__file__))
|
root = os.path.dirname(os.path.abspath(__file__))
|
||||||
sources = path.join(root, "source", "*")
|
sources = path.join(root, "source", "*")
|
||||||
|
|
||||||
for source in glob.glob(path.join(sources, "*")) + glob.glob(path.join(sources, ".*")):
|
for source in glob.glob(path.join(sources, "*")) + glob.glob(
|
||||||
|
path.join(sources, ".*")
|
||||||
|
):
|
||||||
try:
|
try:
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env.pop("PAGER", None)
|
env.pop("PAGER", None)
|
||||||
|
4
tests/syntax-tests/highlighted/resolv.conf/resolv.conf
Normal file
4
tests/syntax-tests/highlighted/resolv.conf/resolv.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[38;2;117;113;94m# A comment[0m
|
||||||
|
[38;2;249;38;114mdomain[0m[38;2;248;248;242m example.com[0m
|
||||||
|
[38;2;249;38;114mnameserver[0m[38;2;248;248;242m 192.168.123.123[0m
|
||||||
|
[38;2;249;38;114mnameserver[0m[38;2;248;248;242m aa00::aaaa:0000:1234:abcd[0m
|
4
tests/syntax-tests/source/resolv.conf/resolv.conf
Normal file
4
tests/syntax-tests/source/resolv.conf/resolv.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# A comment
|
||||||
|
domain example.com
|
||||||
|
nameserver 192.168.123.123
|
||||||
|
nameserver aa00::aaaa:0000:1234:abcd
|
Loading…
Reference in New Issue
Block a user