Merge pull request #237946 from Ma27/pyinv-comp

python3.pkgs.pyinvoke: install shell completions
This commit is contained in:
Artturi 2023-06-17 10:07:33 +03:00 committed by GitHub
commit b71635386d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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/";