Merge pull request #300772 from maxbrunet/feat/mutagen/completion

mutagen: add shell completions
This commit is contained in:
Aleksana 2024-04-02 12:20:32 +08:00 committed by GitHub
commit 1ae6aeea7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub, fetchzip }:
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
buildGoModule rec {
pname = "mutagen";
@ -24,6 +24,8 @@ buildGoModule rec {
hash = "sha256-RFB1/gzLjs9w8mebEd4M9Ldv3BrLIj2RsN/QAIJi45E=";
};
nativeBuildInputs = [ installShellFiles ];
doCheck = false;
subPackages = [ "cmd/mutagen" "cmd/mutagen-agent" ];
@ -33,6 +35,17 @@ buildGoModule rec {
postInstall = ''
install -d $out/libexec
ln -s ${agents}/mutagen-agents.tar.gz $out/libexec/
$out/bin/mutagen generate \
--bash-completion-script mutagen.bash \
--fish-completion-script mutagen.fish \
--zsh-completion-script mutagen.zsh
installShellCompletion \
--cmd mutagen \
--bash mutagen.bash \
--fish mutagen.fish \
--zsh mutagen.zsh
'';
meta = with lib; {