mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
twitch-cli: add shell completions (#440014)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user