mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
glow: install shell completions (#257282)
* glow: install shell completions --------- Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com> Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
parent
ba07d33843
commit
ca37d3417e
@ -1,6 +1,8 @@
|
||||
{ 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";
|
||||
|
Loading…
Reference in New Issue
Block a user