patool: Fix shell completion (#390420)

This commit is contained in:
Aleksana
2025-03-26 20:44:05 +08:00
committed by GitHub
@@ -1,8 +1,10 @@
{
argcomplete,
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
installShellFiles,
pytestCheckHook,
p7zip,
cabextract,
@@ -59,6 +61,17 @@ buildPythonPackage rec {
--replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"'
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd patool \
--bash <(${argcomplete}/bin/register-python-argcomplete -s bash $out/bin/patool) \
--fish <(${argcomplete}/bin/register-python-argcomplete -s fish $out/bin/patool) \
--zsh <(${argcomplete}/bin/register-python-argcomplete -s zsh $out/bin/patool)
'';
nativeBuildInputs = [
installShellFiles
];
nativeCheckInputs = [ pytestCheckHook ] ++ compression-utilities;
disabledTests = [