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:
David Peter 2021-02-16 21:39:38 +01:00 committed by David Peter
parent 0e5ea9c354
commit 94496df3b0
4 changed files with 17 additions and 2 deletions

View File

@ -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-*/**/*",

View File

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

View File

@ -0,0 +1,4 @@
# A comment
domain example.com
nameserver 192.168.123.123
nameserver aa00::aaaa:0000:1234:abcd

View File

@ -0,0 +1,4 @@
# A comment
domain example.com
nameserver 192.168.123.123
nameserver aa00::aaaa:0000:1234:abcd