From 84b070239951a1fff778812393b670cc5c06244d Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 16 Dec 2020 20:41:50 +0100 Subject: [PATCH 1/2] only print themes hint in interactive mode --- CHANGELOG.md | 2 ++ src/bin/bat/main.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef17a38..8cabba21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ## Bugfixes +- only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube) + ## Other ## Syntaxes diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index eb6f75bc..cb50a84f 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -200,19 +200,19 @@ pub fn list_themes(cfg: &Config) -> Result<()> { .ok(); writeln!(stdout)?; } + writeln!( + stdout, + "Further themes can be installed to '{}', \ + and are added to the cache with `bat cache --build`. \ + For more information, see:\n\n \ + https://github.com/sharkdp/bat#adding-new-themes", + config_file().join("themes").to_string_lossy() + )?; } else { for theme in assets.themes() { writeln!(stdout, "{}", theme)?; } } - writeln!( - stdout, - "Further themes can be installed to '{}', \ - and are added to the cache with `bat cache --build`. \ - For more information, see:\n\n \ - https://github.com/sharkdp/bat#adding-new-themes", - config_file().join("themes").to_string_lossy() - )?; Ok(()) } From 60e00d49a99f33eb90397c6932c770d82fd481ec Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 21 Dec 2020 08:16:49 +0100 Subject: [PATCH 2/2] Fix #1443 macOS: regression_test.sh: mktemp: illegal option (#1444) The macOS version of mktemp does not recognize the --suffix option. Using pure -d should work since, it seems [1], macOS 10.11 however. So to make the script work on macOS, stop using the --suffix option. The downside is of course that the temporary dir will have an anonymous name, but I see no risk of confusion given how short-lived the usage of the dir is, and given the context it is used. [1] https://unix.stackexchange.com/questions/30091/fix-or-alternative-for-mktemp-in-os-x --- CHANGELOG.md | 1 + tests/syntax-tests/regression_test.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cabba21..a245131c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ## Bugfixes - only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube) +- Make ./tests/syntax-tests/regression_test.sh work on recent versions of macOS, see #1443 (@Enselic) ## Other diff --git a/tests/syntax-tests/regression_test.sh b/tests/syntax-tests/regression_test.sh index 25acb256..45e2e3ea 100755 --- a/tests/syntax-tests/regression_test.sh +++ b/tests/syntax-tests/regression_test.sh @@ -4,7 +4,7 @@ set -eou pipefail script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -output_directory=$(mktemp -d --suffix=.bat-syntax-regression-test) +output_directory=$(mktemp -d) "$script_directory"/create_highlighted_versions.py --output="$output_directory"