tea: Install shell completions for bash, zsh and fish (#334848)

* install shell completions for `tea`
* set compiletime version
This commit is contained in:
Valentin Brandl
2025-09-06 13:19:17 +02:00
committed by GitHub
parent ffd11aa9be
commit f0ba6d64bf
+17
View File
@@ -2,6 +2,7 @@
lib,
buildGoModule,
fetchFromGitea,
installShellFiles,
}:
buildGoModule rec {
@@ -28,4 +29,20 @@ buildGoModule rec {
];
mainProgram = "tea";
};
ldflags = [
"-X code.gitea.io/tea/cmd.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd tea \
--bash <($out/bin/tea completion bash) \
--fish <($out/bin/tea completion fish) \
--zsh <($out/bin/tea completion zsh)
mkdir $out/share/powershell/ -p
$out/bin/tea completion pwsh > $out/share/powershell/tea.Completion.ps1
'';
}