python3.pkgs.invoke: install shell completions

This commit is contained in:
Maximilian Bosch
2023-06-16 19:41:50 +02:00
parent 7c2a4a4bbf
commit 2dce714dff
@@ -2,7 +2,7 @@
, bash
, buildPythonPackage
, fetchPypi
, pythonOlder
, stdenv
}:
buildPythonPackage rec {
@@ -26,6 +26,13 @@ buildPythonPackage rec {
"invoke"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
mkdir -p $out/share/{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
$out/bin/inv --print-completion-script=zsh >$out/share/zsh/site-functions/_inv
$out/bin/inv --print-completion-script=bash >$out/share/bash-completion/completions/inv.bash
$out/bin/inv --print-completion-script=fish >$out/share/fish/vendor_completions.d/inv.fish
'';
meta = with lib; {
description = "Pythonic task execution";
homepage = "https://www.pyinvoke.org/";