rclone: use installShellFiles
This commit is contained in:
parent
954eab8ea9
commit
0bead921ca
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages }:
|
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }:
|
||||||
|
|
||||||
buildGoPackage rec {
|
buildGoPackage rec {
|
||||||
pname = "rclone";
|
pname = "rclone";
|
||||||
|
@ -17,6 +17,8 @@ buildGoPackage rec {
|
||||||
|
|
||||||
outputs = [ "bin" "out" "man" ];
|
outputs = [ "bin" "out" "man" ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
postInstall =
|
postInstall =
|
||||||
let
|
let
|
||||||
rcloneBin =
|
rcloneBin =
|
||||||
|
@ -25,10 +27,11 @@ buildGoPackage rec {
|
||||||
else stdenv.lib.getBin buildPackages.rclone;
|
else stdenv.lib.getBin buildPackages.rclone;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1
|
installManPage $src/rclone.1
|
||||||
mkdir -p $bin/share/zsh/site-functions $bin/share/bash-completion/completions/
|
for shell in bash zsh; do
|
||||||
${rcloneBin}/bin/rclone genautocomplete zsh $bin/share/zsh/site-functions/_rclone
|
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
|
||||||
${rcloneBin}/bin/rclone genautocomplete bash $bin/share/bash-completion/completions/rclone.bash
|
installShellCompletion rclone.$shell
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
Loading…
Reference in New Issue