mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 17:44:44 +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
|
{ lib
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, installShellFiles
|
||||||
|
, stdenv
|
||||||
}:
|
}:
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "glow";
|
pname = "glow";
|
||||||
@ -19,6 +21,14 @@ buildGoModule rec {
|
|||||||
|
|
||||||
ldflags = [ "-s" "-w" "-X=main.Version=${version}" ];
|
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; {
|
meta = with lib; {
|
||||||
description = "Render markdown on the CLI, with pizzazz!";
|
description = "Render markdown on the CLI, with pizzazz!";
|
||||||
homepage = "https://github.com/charmbracelet/glow";
|
homepage = "https://github.com/charmbracelet/glow";
|
||||||
|
Loading…
Reference in New Issue
Block a user