git-spice: install shell completions for bash, zsh, and fish (#350351)

This commit is contained in:
Sandro 2024-10-22 15:27:42 +02:00 committed by GitHub
commit a703e590a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@
fetchFromGitHub,
git,
nix-update-script,
installShellFiles,
}:
buildGo123Module rec {
@ -22,6 +23,8 @@ buildGo123Module rec {
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
nativeCheckInputs = [ git ];
buildInputs = [ git ];
@ -40,6 +43,13 @@ buildGo123Module rec {
rm testdata/script/branch_submit_multiple_pr_templates.txt
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd gs \
--bash <($out/bin/gs shell completion bash) \
--zsh <($out/bin/gs shell completion zsh) \
--fish <($out/bin/gs shell completion fish)
'';
passthru.updateScript = nix-update-script { };
meta = {