stern: use installShellFiles
This commit is contained in:
parent
16df60734a
commit
954eab8ea9
1 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub }:
|
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub, installShellFiles }:
|
||||||
|
|
||||||
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in
|
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in
|
||||||
|
|
||||||
|
@ -17,13 +17,15 @@ buildGoPackage rec {
|
||||||
|
|
||||||
goDeps = ./deps.nix;
|
goDeps = ./deps.nix;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
postInstall =
|
postInstall =
|
||||||
let stern = if isCrossBuild then buildPackages.stern else "$bin"; in
|
let stern = if isCrossBuild then buildPackages.stern else "$bin"; in
|
||||||
''
|
''
|
||||||
mkdir -p $bin/share/bash-completion/completions
|
for shell in bash zsh; do
|
||||||
${stern}/bin/stern --completion bash > $bin/share/bash-completion/completions/stern
|
${stern}/bin/stern --completion $shell > stern.$shell
|
||||||
mkdir -p $bin/share/zsh/site-functions
|
installShellCompletion stern.$shell
|
||||||
${stern}/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in a new issue