Skip to content

Commit

Permalink
Add bash/zsh completion to cardano-node and cardano-cli packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgi committed Mar 3, 2021
1 parent d850660 commit a87a8aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ let
});
}
{
# Stamp executables with the git revision
# Stamp executables with the git revision and add shell completion
packages = lib.genAttrs ["cardano-node" "cardano-cli"] (name: {
components.exes.${name}.postInstall = ''
${lib.optionalString stdenv.hostPlatform.isWindows setLibSodium}
${setGitRev}
'' + lib.optionalString (!stdenv.hostPlatform.isWindows) ''
BASH_COMPLETIONS=$out/share/bash-completion/completions
ZSH_COMPLETIONS=$out/share/zsh/site-functions
mkdir -p $BASH_COMPLETIONS $ZSH_COMPLETIONS
$out/bin/${name} --bash-completion-script ${name} > $BASH_COMPLETIONS/${name}
$out/bin/${name} --zsh-completion-script ${name} > $ZSH_COMPLETIONS/_${name}
'';
});
}
Expand Down

0 comments on commit a87a8aa

Please sign in to comment.