mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
git-prole: add shell completions
This commit is contained in:
parent
4d82b26c6a
commit
298aa40f23
1 changed files with 24 additions and 2 deletions
|
@ -1,12 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
git,
|
||||
bash,
|
||||
nix-update-script,
|
||||
installShellFiles,
|
||||
}:
|
||||
let
|
||||
emulatorAvailable = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
version = "0.5.3";
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
|
@ -20,14 +24,32 @@ rustPlatform.buildRustPackage {
|
|||
hash = "sha256-QwLkByC8gdAnt6geZS285ErdH8nfV3vsWjMF4hTzq9Y=";
|
||||
};
|
||||
|
||||
buildFeatures = [ "clap_mangen" ];
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-qghc8HtJfpTYXAwC2xjq8lLlCu419Ttnu/AYapkAulI=";
|
||||
|
||||
nativeCheckInputs = [
|
||||
git
|
||||
bash
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString emulatorAvailable ''
|
||||
manpages=$(mktemp -d)
|
||||
${emulator} $out/bin/git-prole manpages "$manpages"
|
||||
for manpage in "$manpages"/*; do
|
||||
installManPage "$manpage"
|
||||
done
|
||||
|
||||
installShellCompletion --cmd git-prole \
|
||||
--bash <(${emulator} $out/bin/git-prole completions bash) \
|
||||
--fish <(${emulator} $out/bin/git-prole completions fish) \
|
||||
--zsh <(${emulator} $out/bin/git-prole completions zsh)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/9999years/git-prole";
|
||||
changelog = "https://github.com/9999years/git-prole/releases/tag/v${version}";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue