Unverified Commit 6378f273 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

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

parents a7671c23 c6c76abb
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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";