bat-extras: minor improvements

This commit is contained in:
PerchunPak
2025-10-23 11:02:36 +02:00
parent 2b9d36ae10
commit 428deb18ab
2 changed files with 11 additions and 9 deletions
@@ -12,6 +12,7 @@
}:
let
cleanArgs = lib.flip removeAttrs [
"name"
"dependencies"
"meta"
];
@@ -26,6 +27,7 @@ stdenv.mkDerivation (
finalAttrs:
cleanArgs args
// {
pname = name;
inherit (core) version;
src = core;
@@ -35,14 +37,14 @@ stdenv.mkDerivation (
buildInputs = dependencies;
# Patch shebangs now because our tests rely on them
postPatch = ''
postPatch = (args.postPatch or "") + ''
patchShebangs --host bin/${name}
'';
dontConfigure = true;
dontBuild = true; # we've already built
dontBuild = true; # we've already built it
doCheck = true;
doCheck = args.doCheck or true;
nativeCheckInputs = [
bat
bash
@@ -52,7 +54,7 @@ stdenv.mkDerivation (
++ (lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]);
checkPhase = ''
runHook preCheck
bash ./test.sh --compiled --suite ${name}
bash ./test.sh --compiled --suite ${name} --verbose --snapshot:show
runHook postCheck
'';
@@ -69,7 +71,7 @@ stdenv.mkDerivation (
runHook postInstall
'';
# We already patched
# We have already patched
dontPatchShebangs = true;
meta = core.meta // { mainProgram = name; } // meta;
@@ -7,7 +7,7 @@ diff --git a/test/suite/batpipe.sh b/test/suite/batpipe.sh
test:batpipe_term_width() {
description "Test support for BATPIPE_TERM_WIDTH"
snapshot STDOUT
+ skip "bat-extras does not support `--theme` flag"
+ skip "bat-extras does not support '--theme' flag"
export BATPIPE=color
export BATPIPE_DEBUG_PARENT_EXECUTABLE=less
@@ -20,7 +20,7 @@ diff --git a/test/suite/batgrep.sh b/test/suite/batgrep.sh
description "Snapshot test for colored output."
snapshot stdout
snapshot stderr
+ skip "bat-extras does not support `--theme` flag"
+ skip "bat-extras does not support '--theme' flag"
require_rg
@@ -28,7 +28,7 @@ diff --git a/test/suite/batgrep.sh b/test/suite/batgrep.sh
description "Should respect the BAT_STYLE variable."
snapshot stdout
snapshot stderr
+ skip "bat-extras does not support `--theme` flag"
+ skip "bat-extras does not support '--theme' flag"
require_rg
@@ -36,7 +36,7 @@ diff --git a/test/suite/batgrep.sh b/test/suite/batgrep.sh
description "Snapshot test for output without separator"
snapshot stdout
snapshot stderr
+ skip "bat-extras does not support `--theme` flag"
+ skip "bat-extras does not support '--theme' flag"
require_rg