Skip to content

Commit

Permalink
Add bash completion to cardano-node and cardano-cli package.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgi committed Mar 2, 2021
1 parent d850660 commit 8c321da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nix/haskell.nix
Expand Up @@ -79,11 +79,18 @@ 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}
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 8c321da

Please sign in to comment.