Unverified Commit ca37d341 authored by thenbe's avatar thenbe Committed by GitHub
Browse files

glow: install shell completions (#257282)



* glow: install shell completions

---------

Co-authored-by: default avatarWeijia Wang <9713184+wegank@users.noreply.github.com>
Co-authored-by: default avatarJörg Thalheim <Mic92@users.noreply.github.com>
parent ba07d338
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, stdenv
}:
buildGoModule rec {
  pname = "glow";
@@ -19,6 +21,14 @@ buildGoModule rec {

  ldflags = [ "-s" "-w" "-X=main.Version=${version}" ];

  nativeBuildInputs = [ installShellFiles ];
  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd glow \
      --bash <($out/bin/glow completion bash) \
      --fish <($out/bin/glow completion fish) \
      --zsh <($out/bin/glow completion zsh)
  '';

  meta = with lib; {
    description = "Render markdown on the CLI, with pizzazz!";
    homepage = "https://github.com/charmbracelet/glow";