twitch-cli: add shell completions (#440014)

This commit is contained in:
Peder Bergebakken Sundt
2025-09-12 10:11:46 +00:00
committed by GitHub

View File

@@ -1,6 +1,8 @@
{
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
lib,
testers,
twitch-cli,
@@ -33,6 +35,18 @@ buildGoModule rec {
export HOME=$(mktemp -d)
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/twitch-cli completion bash > twitch-cli.bash
$out/bin/twitch-cli completion fish > twitch-cli.fish
$out/bin/twitch-cli completion zsh > _twitch-cli
installShellCompletion --cmd twitch-cli \
--bash twitch-cli.bash \
--fish twitch-cli.fish \
--zsh _twitch-cli
'';
__darwinAllowLocalNetworking = true;
passthru.tests.version = testers.testVersion {