mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +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,
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildPackages,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
git,
|
git,
|
||||||
bash,
|
|
||||||
nix-update-script,
|
nix-update-script,
|
||||||
|
installShellFiles,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
emulatorAvailable = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
||||||
|
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||||
version = "0.5.3";
|
version = "0.5.3";
|
||||||
in
|
in
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
|
@ -20,14 +24,32 @@ rustPlatform.buildRustPackage {
|
||||||
hash = "sha256-QwLkByC8gdAnt6geZS285ErdH8nfV3vsWjMF4hTzq9Y=";
|
hash = "sha256-QwLkByC8gdAnt6geZS285ErdH8nfV3vsWjMF4hTzq9Y=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildFeatures = [ "clap_mangen" ];
|
||||||
|
|
||||||
useFetchCargoVendor = true;
|
useFetchCargoVendor = true;
|
||||||
cargoHash = "sha256-qghc8HtJfpTYXAwC2xjq8lLlCu419Ttnu/AYapkAulI=";
|
cargoHash = "sha256-qghc8HtJfpTYXAwC2xjq8lLlCu419Ttnu/AYapkAulI=";
|
||||||
|
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [
|
||||||
git
|
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 = {
|
meta = {
|
||||||
homepage = "https://github.com/9999years/git-prole";
|
homepage = "https://github.com/9999years/git-prole";
|
||||||
changelog = "https://github.com/9999years/git-prole/releases/tag/v${version}";
|
changelog = "https://github.com/9999years/git-prole/releases/tag/v${version}";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue