exercism: install shell completions
Exercism ships both with pre-generated completions [0], and has `completion` command to generate completions for bash/zsh/fish/powershell. Initially I was planning to use the latter, but seems like due to a bug (?) in cobra-generated completions (probably [1]), the resulting completions aren't fully working (if at all); so this makes use of the ones provided in the repo. I'll probably update this once more to use auto-generated completions once I manage to update cobra dependency for exercism CLI itself. [0] https://github.com/exercism/cli/tree/main/shell [1] https://github.com/spf13/cobra/pull/1940
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
installShellFiles,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
}:
|
||||
@@ -22,8 +23,17 @@ buildGoModule rec {
|
||||
|
||||
subPackages = [ "./exercism" ];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd exercism \
|
||||
--bash shell/exercism_completion.bash \
|
||||
--fish shell/exercism.fish \
|
||||
--zsh shell/exercism_completion.zsh
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
inherit (src.meta) homepage;
|
||||
description = "Go based command line tool for exercism.io";
|
||||
|
||||
Reference in New Issue
Block a user