git-cliff: Add man page and shell completion (#346697)

This commit is contained in:
Aleksana 2024-10-17 12:08:49 +08:00 committed by GitHub
commit 6378f273ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@
, rustPlatform
, Security
, SystemConfiguration
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
@ -26,6 +27,23 @@ rustPlatform.buildRustPackage rec {
Security SystemConfiguration
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export OUT_DIR=$(mktemp -d)
# Generate shell completions
$out/bin/git-cliff-completions
installShellCompletion \
--bash $OUT_DIR/git-cliff.bash \
--fish $OUT_DIR/git-cliff.fish \
--zsh $OUT_DIR/_git-cliff
# Generate man page
$out/bin/git-cliff-mangen
installManPage $OUT_DIR/git-cliff.1
'';
meta = with lib; {
description = "Highly customizable Changelog Generator that follows Conventional Commit specifications";
homepage = "https://github.com/orhun/git-cliff";