mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
air-formatter: add shell completions
This commit is contained in:
parent
9094d87eac
commit
c6914f42d8
1 changed files with 11 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
fetchFromGitHub,
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
installShellFiles,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "air-formatter";
|
||||
|
|
@ -32,6 +33,16 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
# TODO: Upstream also provides Elvish and PowerShell completions,
|
||||
# but `installShellCompletion` only has support for Bash, Zsh and Fish at the moment.
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd air-formatter \
|
||||
--bash <($out/bin/air generate-shell-completion bash) \
|
||||
--fish <($out/bin/air generate-shell-completion fish) \
|
||||
--zsh <($out/bin/air generate-shell-completion zsh)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Extremely fast R code formatter";
|
||||
homepage = "https://posit-dev.github.io/air";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue